聊天:获得橙色武将推送系统消息

测试:增加删除武将等测试接口
This commit is contained in:
liangtongchuan
2021-03-08 17:37:13 +08:00
parent 07a9c74145
commit a0b92872c2
7 changed files with 102 additions and 12 deletions
+10 -2
View File
@@ -203,10 +203,18 @@ export function wrapRichText(type: string, jumpTo: string, content: string, parm
});
}
export async function pushHeroQualityUpMsg(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
export async function pushNormalHeroInfoBySource(roleId: string, roleName: string, serverId: number | string, source: number, heroInfo: Partial<HeroType>) {
const hero = pick(heroInfo, ['hName', 'hid', 'seqId', 'quality']);
const content = JSON.stringify({ roleId, roleName, hero });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.HERO_QUALITY_UP, content, null, null);
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, source, content, null, null);
const roomId = groupRoomId(CHANNEL_PREFIX.SYS, `${serverId}`);
await pushGroupMsgToRoom(roomId, msgData);
}
export async function pushHeroQualityUpMsg(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.HERO_QUALITY_UP, heroInfo);
}
export async function pushComposeOrangeHero(roleId: string, roleName: string, serverId: number | string, heroInfo: Partial<HeroType>) {
await pushNormalHeroInfoBySource(roleId, roleName, serverId, MSG_SOURCE.COMPOSE_ORANGE_HERO, heroInfo);
}