热更新:handler监听热更新
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user