聊天:举报接口及测试

This commit is contained in:
liangtongchuan
2021-03-11 17:27:37 +08:00
parent 3bbd8627bd
commit f91818b354
4 changed files with 64 additions and 18 deletions
+9
View File
@@ -11,6 +11,7 @@ import { CHANNEL_PREFIX, MSG_CODE_LEN, MSG_STATUS, ON_PRIVATE_MSG_ROUTE, RECENT_
import { getRoleOnlineInfo } from './redisService';
import { ChatInfoModel } from '../db/ChatInfo';
import { channelServer } from './chatChannelService';
import { AccuseRecModel, AccueseParam } from '../db/AccuseRec';
export * from './chatChannelService';
export * from './sysChatService';
@@ -295,3 +296,11 @@ export async function pushTeamInviteMsg(roleId: string, roleName: string, server
await pushGroupMsgToRoom(msgData);
return msgData;
}
export async function createAccuseData(roleId: string, targetRoleId: string, targetMsgCode: string, reason: number) {
const data: AccueseParam = {
roleId, targetRoleId, targetMsgCode, reason
};
const result = await AccuseRecModel.createRec(data);
return result;
}