聊天:加入部分假数据;加入一个服务器群推
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { CHANNEL_PREFIX } from './../../../consts/constModules/chatConst';
|
||||
import { CHANNEL_PREFIX, MSG_SOURCE } from './../../../consts/constModules/chatConst';
|
||||
import {Application, BackendSession} from 'pinus';
|
||||
import { resResult } from '../../../pubUtils/util';
|
||||
import { DEFAULT_MSG_PER_PAGE, STATUS } from '../../../consts';
|
||||
@@ -83,7 +83,7 @@ export class ChatHandler {
|
||||
if (channel === CHANNEL_PREFIX.SYS) return resResult(STATUS.SYS_CHANNEL_AUTH_NOT_ENOUGH);
|
||||
const roleId = session.get('roleId');
|
||||
const roleName = session.get('roleName');
|
||||
const msgData = await createGroupMsg(roleId, roleName, channel, channelId, type, content, targetRoleId, targetMsgCode);
|
||||
const msgData = await createGroupMsg(roleId, roleName, channel, channelId, type, MSG_SOURCE.ROLE_SEND_TEXT, content, targetRoleId, targetMsgCode);
|
||||
await pushGroupMsgToRoom(groupRoomId(channel, channelId), msgData);
|
||||
if (!msgData) return resResult(STATUS.WRONG_PARMS);
|
||||
return resResult(STATUS.SUCCESS);
|
||||
@@ -99,7 +99,7 @@ export class ChatHandler {
|
||||
const { type, content, targetRoleId, targetMsgCode } = msg;
|
||||
const roleId = session.get('roleId');
|
||||
const roleName = session.get('roleName');
|
||||
const msgData = await createPrivateMsg(roleId, roleName, type, content, targetRoleId, targetMsgCode);
|
||||
const msgData = await createPrivateMsg(roleId, roleName, type, MSG_SOURCE.ROLE_SEND_TEXT, content, targetRoleId, targetMsgCode);
|
||||
await pushMsgToRole(targetRoleId, msgData);
|
||||
if (!msgData) return resResult(STATUS.WRONG_PARMS);
|
||||
return resResult(STATUS.SUCCESS, msgData);
|
||||
|
||||
Reference in New Issue
Block a user