邮件:修改邮件逻辑
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user