后台:停服维护
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user