27 lines
584 B
TypeScript
27 lines
584 B
TypeScript
|
|
import { Service } from 'egg';
|
|
import { MaintenanceModel } from '@db/Maintenance';
|
|
|
|
/**
|
|
* Test Service
|
|
*/
|
|
export default class Game extends Service {
|
|
|
|
public setServerMainten(maintenServers: number[]) {
|
|
return this.app['maintenServers'] = maintenServers;
|
|
}
|
|
|
|
public getServerMainten() {
|
|
return this.app['maintenServers']||[];
|
|
}
|
|
|
|
public async readDbMaintenance() {
|
|
const maintenance = await MaintenanceModel.findOpenMaintenance();
|
|
if(maintenance) {
|
|
this.setServerMainten(maintenance.serverIds);
|
|
}
|
|
}
|
|
|
|
|
|
}
|