后台:跑马灯
This commit is contained in:
@@ -12,6 +12,7 @@ import { SendMailFun } from '../../../services/mailService';
|
||||
import { createNewServer, sendOpenServerMail } from '../../../services/gmService';
|
||||
import { initAutoCreateServer, initMaintenance, stopMaintenance } from '../../../services/timeTaskService';
|
||||
import { isNumber } from 'util';
|
||||
import { MarqueeModel } from '../../../db/Marquee';
|
||||
let timer: NodeJS.Timer;
|
||||
export default function (app: Application) {
|
||||
return new GmHandler(app);
|
||||
@@ -101,4 +102,23 @@ export class GmHandler {
|
||||
|
||||
return resResult(STATUS.SUCCESS,);
|
||||
}
|
||||
|
||||
async sendMarquee(msg: { code: string }, session: BackendSession) {
|
||||
const { code } = msg;
|
||||
let marquee = await MarqueeModel.findByCode(code);
|
||||
if(!marquee) return resResult(STATUS.DB_DATA_NOT_FOUND);
|
||||
|
||||
await MarqueeModel.updateData(code, { isEnable: true });
|
||||
let result = await this.app.rpc.systimer.systimerRemote.setMarquee.broadcast(marquee);
|
||||
if (!result) return resResult(STATUS.GM_MARQUEE_ERR);
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
|
||||
async cancelMarquee(msg: { code: string }, session: BackendSession) {
|
||||
const { code } = msg;
|
||||
await MarqueeModel.updateData(code, { isEnable: false });
|
||||
let result = await this.app.rpc.systimer.systimerRemote.cancelMarquee.broadcast(code);
|
||||
if (!result) return resResult(STATUS.GM_MARQUEE_CANCEL_ERR);
|
||||
return resResult(STATUS.SUCCESS);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user