邮件:修改邮件逻辑

This commit is contained in:
luying
2021-06-28 13:31:29 +08:00
parent 2ffe0f7890
commit 3b1d458a87
29 changed files with 932 additions and 626 deletions
@@ -9,6 +9,7 @@ import { getWorldChannelSid, groupRoomId } from '../../../services/chatService';
import { reloadResources } from '../../../pubUtils/data';
import { GeneralRankParamRole, GeneralRankParamBattle } from '../../../domain/rank';
import { getAllGuildActivityStatus } from '../../../services/guildActivityService';
import { MailParam } from '../../../domain/roleField/mail';
export default function (app: Application) {
return new ChatRemote(app);
@@ -225,4 +226,17 @@ export class ChatRemote {
let guildActivities = getAllGuildActivityStatus();
channel.pushMessage(this.GUILD_ACTIVITY_STATUS_UPDATE, resResult(STATUS.SUCCESS, { guildActivities }));
}
/**
* 向全服推送邮件
* @param serverId 服务器id
* @param path 推送地址
* @param mails 邮件内容
*/
public async sendMail(serverId: number, path: string, data: { mails: MailParam[] }) {
let roomId = groupRoomId(CHANNEL_PREFIX.WORLD, serverId);
let channel = this.channelService.getChannel(roomId, false);
if (!channel) return;
channel.pushMessage(path, resResult(STATUS.SUCCESS, data));
}
}