热更新:handler监听热更新

This commit is contained in:
qiaoxin
2021-07-16 11:29:26 +08:00
parent dc15862207
commit fc1b2c080e
65 changed files with 321 additions and 254 deletions
@@ -1,4 +1,4 @@
import { Application, ChannelService } from 'pinus';
import { Application, ChannelService, HandlerService, } from 'pinus';
import { resResult } from '../../../pubUtils/util';
import { STATUS } from '../../../consts';
import { setGmMails, getGmMailById, getGmMails, getGmUseMails } from '../../../pubUtils/gmData/gmDataUtil';
@@ -11,6 +11,7 @@ import { MailType } from '../../../db/Mail';
import { mongoose } from '@typegoose/typegoose';
const { ObjectId } = mongoose.Types;
export default function (app: Application) {
new HandlerService(app, {});
return new GMRemote(app);
}
@@ -100,7 +101,7 @@ export class GMRemote {
channel.pushMessage('onLeave', resResult(STATUS.SUCCESS, param));
}
public refreshGmMails(mails:[any]) {
public refreshGmMails(mails: [any]) {
setGmMails(mails);
}
@@ -109,7 +110,7 @@ export class GMRemote {
* @param updatedMailAt
* @param serverId
*/
public getMailsByTime(updatedMailAt: number, serverId: number) {
public getMailsByTime(updatedMailAt: number, serverId: number) {
let gmMails = getGmMails(updatedMailAt, serverId);
return gmMails;
}
@@ -163,7 +164,7 @@ export class GMRemote {
* @param serverId
* @param nowTime
*/
public getUseGmMailById(mailId: string, serverId: number, nowTime: number ) {
public getUseGmMailById(mailId: string, serverId: number, nowTime: number) {
let gmMail = getGmMailById(mailId, serverId, nowTime);
return gmMail;
}