聊天:修改部分接口字段和命名

This commit is contained in:
liangtongchuan
2021-03-11 17:01:15 +08:00
parent 75fb82316d
commit 3bbd8627bd
8 changed files with 27 additions and 18 deletions

View File

@@ -62,7 +62,7 @@ export async function pushGuildUpStructureMsg(roleId: string, roleName: string,
export async function pushGuildTrainSucMsg(roleId: string, roleName: string, guildCode: string, hid: number) {
if (!guildCode) return null;
const content = JSON.stringify({ hid });
const content = JSON.stringify({ roleId, roleName, hid });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.GUILD, guildCode, MSG_TYPE.RICH_TEXT, MSG_SOURCE.GUILD_TRAIN_SUC, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;
@@ -70,7 +70,7 @@ export async function pushGuildTrainSucMsg(roleId: string, roleName: string, gui
export async function pushGuildBossSucMsg(roleId: string, roleName: string, guildCode: string, bossInstance: BossInstanceType) {
const boss = pick(bossInstance, ['warId', 'bossLv']);
const content = JSON.stringify({ boss });
const content = JSON.stringify({ roleId, roleName, boss });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.GUILD, guildCode, MSG_TYPE.RICH_TEXT, MSG_SOURCE.GUILD_BOSS_SUC, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;
@@ -78,14 +78,14 @@ export async function pushGuildBossSucMsg(roleId: string, roleName: string, guil
export async function pushEquipRefineSucMsg(roleId: string, roleName: string, serverId: number, eplace: Partial<EPlace>) {
const data = pick(eplace, ['id', 'lv', 'refineLv']);
const content = JSON.stringify({ eplace: data });
const content = JSON.stringify({ roleId, roleName, eplace: data });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, MSG_SOURCE.EQUIP_REFINE_SUC, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;
}
export async function pushNormalEquipMsg(roleId: string, roleName: string, serverId: number, source: number, id: number, name: string) {
const content = JSON.stringify({ id, name });
const content = JSON.stringify({ roleId, roleName, equip: { id, name } });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, source, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;
@@ -93,14 +93,14 @@ export async function pushNormalEquipMsg(roleId: string, roleName: string, serve
export async function pushTowerMsg(roleId: string, roleName: string, serverId: number, source: number, lv: number) {
if (!shouldPushTowerMsg(lv)) return null;
const content = JSON.stringify({ lv });
const content = JSON.stringify({ roleId, roleName, lv });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, source, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;
}
async function pushGKFirstMsg(roleId: string, roleName: string, serverId: number, source: number, warType: number, warId: number) {
const content = JSON.stringify({ warType, warId });
const content = JSON.stringify({ roleId, roleName, warInfo: { warType, warId } });
const msgData = await createGroupMsg(roleId, roleName, CHANNEL_PREFIX.SYS, `${serverId}`, MSG_TYPE.RICH_TEXT, source, content, null, null);
await pushGroupMsgToRoom(msgData);
return msgData;