登录:公告读数据库
This commit is contained in:
@@ -2,6 +2,7 @@ import { STATUS } from '@consts';
|
||||
import { GameModel } from '@db/Game';
|
||||
import { Controller } from 'egg';
|
||||
import { RoleModel } from '@db/Role';
|
||||
import { NoticeModel } from '@db/Notice';
|
||||
import { ServerParamWithRole, GroupParam } from '../domain/gameField/serverlist';
|
||||
|
||||
export default class GameController extends Controller {
|
||||
@@ -67,16 +68,15 @@ export default class GameController extends Controller {
|
||||
let { serverType } = ctx;
|
||||
|
||||
console.log(serverType);
|
||||
let notice = [{
|
||||
id: 1,
|
||||
title: '粮草先行',
|
||||
tag: 1,
|
||||
type: 1,
|
||||
content: '欢迎来到三国志赵云传',
|
||||
startTime: 1584921600,
|
||||
endTime: 1585353600
|
||||
}]
|
||||
ctx.body = ctx.service.utils.resResult(STATUS.SUCCESS, { notice });
|
||||
let notice = await NoticeModel.getAllNotice(serverType);
|
||||
let result = notice.map(cur => {
|
||||
let {id, title, tag, type, content, time} = cur;
|
||||
return {
|
||||
id, title, tag, type, content, time
|
||||
}
|
||||
})
|
||||
|
||||
ctx.body = ctx.service.utils.resResult(STATUS.SUCCESS, { notice: result });
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user