聊天:军团消息中添加用户信息
This commit is contained in:
@@ -8,6 +8,7 @@ import { isArray, isString } from 'underscore';
|
|||||||
import { pinus } from 'pinus';
|
import { pinus } from 'pinus';
|
||||||
import { resResult } from '../pubUtils/util';
|
import { resResult } from '../pubUtils/util';
|
||||||
import { BossInstanceType } from '../db/BossInstance';
|
import { BossInstanceType } from '../db/BossInstance';
|
||||||
|
import { getSimpleRoleInfo } from './roleService';
|
||||||
|
|
||||||
async function pushNormalHeroInfoBySource(roleId: string, roleName: string, serverId: number | string, source: number, heroInfo: Partial<HeroType>) {
|
async function pushNormalHeroInfoBySource(roleId: string, roleName: string, serverId: number | string, source: number, heroInfo: Partial<HeroType>) {
|
||||||
const hero = pick(heroInfo, ['hName', 'hid', 'seqId', 'quality', 'star', 'starStage', 'colorStar', 'colorStarStage']);
|
const hero = pick(heroInfo, ['hName', 'hid', 'seqId', 'quality', 'star', 'starStage', 'colorStar', 'colorStarStage']);
|
||||||
@@ -38,7 +39,8 @@ export async function pushComBtlTeamMsg(teamCode: string, roleId: string, roleNa
|
|||||||
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.TEAM, teamCode, type, source, content, targetRoleId, targetMsgCode);
|
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.TEAM, teamCode, type, source, content, targetRoleId, targetMsgCode);
|
||||||
if (!msgData) return null;
|
if (!msgData) return null;
|
||||||
const channel = pinus.app.get('channelService').getChannel(teamCode);
|
const channel = pinus.app.get('channelService').getChannel(teamCode);
|
||||||
channel.pushMessage(ON_GROUP_MSG_ROUTE, resResult(STATUS.SUCCESS, msgData));
|
const roleInfo = await getSimpleRoleInfo(msgData.roleId);
|
||||||
|
channel.pushMessage(ON_GROUP_MSG_ROUTE, resResult(STATUS.SUCCESS, { ...msgData, roleInfo }));
|
||||||
return msgData;
|
return msgData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user