
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 async getServerMainten() {
        // return this.app['maintenServers']||[];

        const maintenance = await MaintenanceModel.findOpenMaintenance();
        if(maintenance) {
            return maintenance.serverIds;
        } else {
            return [];
        }
    }

    // public async readDbMaintenance() {
    //     const maintenance = await MaintenanceModel.findOpenMaintenance();
    //     if(maintenance) {
    //         this.setServerMainten(maintenance.serverIds);
    //     }
    // }


}
