推送:对单人推送函数抽象

This commit is contained in:
luying
2022-04-09 10:28:21 +08:00
parent f486a8d8a5
commit 26a649b213
32 changed files with 146 additions and 703 deletions
+3 -4
View File
@@ -10,7 +10,7 @@ import { HeroModel, HeroType, HeroUpdate } from '../db/Hero';
import { RoleUpdate, RoleType, RoleModel } from '../db/Role';
import { Rank } from './rankService';
import { HERO_SYSTEM_TYPE, REDIS_KEY } from '../consts';
import { HERO_SYSTEM_TYPE, PUSH_ROUTE, REDIS_KEY } from '../consts';
import { updateUserInfo } from './redisService';
import { GuildModel, GuildType } from '../db/Guild';
import { CalCe } from './role/calCe';
@@ -20,6 +20,7 @@ import { saveCeChangeLog } from '../pubUtils/logUtil';
import { JewelType } from '../db/Jewel';
import { SchoolModel } from '../db/School';
import { AttributeCal } from '../domain/roleField/attribute';
import { sendMessageToUserWithSuc } from './pushService';
interface Param {
isInitRole?: boolean,
@@ -334,9 +335,7 @@ export async function calculateCes(type: HERO_SYSTEM_TYPE, roleId: string, serve
saveCeChangeLog(role, roleInc, role.ce, type, changeHids);
updateRank(roleId, serverId, topLineupCe, role, pushHeros, guild);
let uids = [{ uid: roleId, sid }];
pinus.app.get('channelService').pushMessageByUids('onPlayerCeUpdate', resResult(STATUS.SUCCESS, { ce: role.ce, heros: pushHeros, topLineupCe }), uids);
sendMessageToUserWithSuc(roleId, PUSH_ROUTE.PLAYER_CE_UPDATE, { ce: role.ce, heros: pushHeros, topLineupCe }, sid);
if(guild) {
await updateUserInfo(REDIS_KEY.GUILD_INFO, guild.code, [{ field: 'guildCe', value: guild.guildCe }]);