优化:抽象推送方法
This commit is contained in:
@@ -18,6 +18,7 @@ import _ = require("underscore");
|
||||
import { getGoldObject } from "./role/rewardService";
|
||||
import { SurveyRecModel } from "../db/SurveyRec";
|
||||
import { SurveyModel } from "../db/Survery";
|
||||
import { pushGuildInfoUpdate } from "./guildService";
|
||||
|
||||
// 检查私聊是否合法
|
||||
|
||||
@@ -142,8 +143,7 @@ export async function treatGuildName(content: string) {
|
||||
await GuildModel.updateInfo(params.code, { name: newName, sdkMark: false });
|
||||
// 通知处理
|
||||
await sendMailToGuildByContent(MAIL_TYPE.TREAT_GUILD_INFO, params.code, {}); // 邮件
|
||||
let chatSid = await getGuildChannelSid(params.code);
|
||||
pinus.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, params.code, { name: newName }); // 军团推送
|
||||
await pushGuildInfoUpdate(params.code, { name: newName });
|
||||
await updateUserInfo(REDIS_KEY.GUILD_INFO, params.code, [{ field: 'name', value: newName }]); // redis缓存信息
|
||||
for(let roleId of guild.members) {
|
||||
await updateUserInfo(REDIS_KEY.USER_INFO, roleId, [{ field: 'guildName', value: newName }]);
|
||||
@@ -155,8 +155,7 @@ export async function treatGuildName(content: string) {
|
||||
await GuildModel.updateInfo(params.code, { notice: ' ', sdkMark: false });
|
||||
// 通知处理
|
||||
await sendMailToGuildByContent(MAIL_TYPE.TREAT_GUILD_INFO, params.code, {}); // 邮件
|
||||
let chatSid = await getGuildChannelSid(params.code);
|
||||
pinus.app.rpc.chat.guildRemote.updateInfo.toServer(chatSid, params.code, { notice: '' }); // 军团推送
|
||||
await pushGuildInfoUpdate(params.code, { notice: '' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user