✨ feat(线上维护): json线上更新方案
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Application, ChannelService, HandlerService, } from 'pinus';
|
||||
import { ActivityModel, ActivityModelType } from '../../../db/Activity';
|
||||
import { ServerlistModel } from '../../../db/Serverlist';
|
||||
import { reloadResources } from '../../../pubUtils/data';
|
||||
import { gameData, reloadResources } from '../../../pubUtils/data';
|
||||
import { getServerMainten, setServerMainten, stopServerMainten } from '../../../services/gmService';
|
||||
import { taflush } from '../../../services/sdkService';
|
||||
import { ActivityInRemote } from '../../../domain/activityField/activityField';
|
||||
@@ -13,6 +13,7 @@ import { setApiIsClose } from '../../../services/chatService';
|
||||
import { setKvToMemory } from '../../../services/pushService';
|
||||
import { sendPublicAccountGift } from '../../../services/activity/bindPhoneService';
|
||||
import { setHiddenData } from '../../../services/memoryCache/hiddenData';
|
||||
import * as dicParam from '../../../pubUtils/dicParam';
|
||||
|
||||
export default function (app: Application) {
|
||||
new HandlerService(app, {});
|
||||
@@ -31,9 +32,26 @@ export class ActivityRemote {
|
||||
/**
|
||||
* 重载json资源
|
||||
*/
|
||||
public async reloadResources() {
|
||||
public reloadResources(type?: string) {
|
||||
try {
|
||||
reloadResources();
|
||||
reloadResources(type);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async setDicParam(field1: string, field2: string, value: string|number) {
|
||||
try {
|
||||
if(dicParam[field1] && dicParam[field1][field2]) dicParam[field1][field2] = value;
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async setGameDataToApp() {
|
||||
try {
|
||||
this.app.set('gameData', gameData);
|
||||
this.app.set('dicParam', dicParam);
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
@@ -183,4 +201,12 @@ export class ActivityRemote {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
|
||||
public async fun() {
|
||||
try {
|
||||
console.log('预留一个函数,用于之后线上维护时需要使用');
|
||||
} catch(e) {
|
||||
errlogger.error(`remote ${__filename} \n ${e.stack}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user