后台:停服维护

This commit is contained in:
luying
2021-07-16 15:33:28 +08:00
parent 4d1723b5c2
commit 23750e89b9
9 changed files with 211 additions and 37 deletions

View File

@@ -1,4 +1,5 @@
import { Controller } from 'egg';
import { STATUS } from '@consts';
export default class GameController extends Controller {
@@ -22,6 +23,35 @@ export default class GameController extends Controller {
return
}
public async getMaintenanceList() {
const { ctx } = this;
const {page, pageSize, sortField, sortOrder, form} = ctx.request.body;
ctx.body = await ctx.service.game.getMaintenanceList(page, pageSize, sortField, sortOrder, form);
return
}
public async updateMaintenance() {
const { ctx } = this;
const {values, marquee, notice, mail} = ctx.request.body;
let goods = [];
try{
goods = JSON.parse(mail.goods);
} catch(e) {
ctx.body = ctx.service.utils.resResult(STATUS.GM_JSON_FORMAT_ERR);
return
}
console.log(goods)
ctx.body = await ctx.service.game.updateMaintenance(
{...values, startTime: new Date(values.startTime)},
{...marquee, startTime: new Date(marquee.startTime), endTime: new Date(marquee.endTime)},
{...notice, showStartTime: new Date(notice.showStartTime), showEndTime: new Date(notice.showEndTime), startTime: new Date(notice.startTime), endTime: new Date(notice.endTime)},
{...mail, goods});
return
}
public async getServerStategyList() {
const { ctx } = this;
const { page, pageSize, sortField, sortOrder, form } = ctx.request.body;