后台:停止维护逻辑
This commit is contained in:
@@ -203,7 +203,7 @@ export class GmHandler {
|
||||
const uid = session.get('uid');
|
||||
const maintenance = await MaintenanceModel.updateStatusByCode(code, false, uid);
|
||||
if(!maintenance) return resResult(STATUS.WRONG_PARMS);
|
||||
await stopMaintenance(maintenance);
|
||||
await stopMaintenance(maintenance, uid);
|
||||
|
||||
return resResult(STATUS.SUCCESS,);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import { pinus } from "pinus";
|
||||
import { getWorldChannelSid } from "./chatChannelService";
|
||||
import { ServerlistModel } from "../db/Serverlist";
|
||||
import { NoticeModel, NoticeType } from "../db/Notice";
|
||||
import { SendMailFun } from "./mailService";
|
||||
import { GMMailType } from '../db/GMMail';
|
||||
|
||||
// —————————————— 跑马灯 —————————————— //
|
||||
// 初始
|
||||
@@ -146,8 +148,8 @@ async function startMaintenance(maintenance: MaintenanceType, startJob?: Job) {
|
||||
}
|
||||
|
||||
// 停止维护
|
||||
export async function stopMaintenance(maintenance: MaintenanceType) {
|
||||
let { serverIds, notice, marquee } = maintenance;
|
||||
export async function stopMaintenance(maintenance: MaintenanceType, uid: number) {
|
||||
let { serverIds, notice, marquee, mail } = maintenance;
|
||||
// 更新serverlist上的status
|
||||
await ServerlistModel.updateByServerIds(serverIds, { serverStatus: SERVER_STATUS.HOT });
|
||||
// 更新notice的isEnable
|
||||
@@ -164,4 +166,11 @@ export async function stopMaintenance(maintenance: MaintenanceType) {
|
||||
if(marquee) {
|
||||
await cancelMarquee((<MarqueeType>marquee).code);
|
||||
}
|
||||
console.log('*****', JSON.stringify(mail));
|
||||
if(mail) {
|
||||
let f = new SendMailFun();
|
||||
await f.setWithGmMail((<GMMailType>mail)._id);
|
||||
await f.sendToServer(serverIds);
|
||||
await f.saveRecord(uid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user