后台:添加服务器列表
This commit is contained in:
@@ -14,6 +14,12 @@ export default class GameController extends Controller {
|
||||
return
|
||||
}
|
||||
|
||||
public async getServerList() {
|
||||
const { ctx } = this;
|
||||
ctx.body = await ctx.service.game.getServerList();
|
||||
return
|
||||
}
|
||||
|
||||
public async getDicHero() {
|
||||
const { ctx } = this;
|
||||
ctx.body = await ctx.service.game.getDicHero();
|
||||
|
||||
@@ -45,6 +45,7 @@ export default (app: Application) => {
|
||||
|
||||
router.post('/api/game/getserverenv', tokenParser, controller.game.getServerEnv);
|
||||
router.post('/api/game/getserverlistbyenv', tokenParser, controller.game.getServerListByEnv);
|
||||
router.post('/api/game/getserverlist', controller.game.getServerList);
|
||||
router.post('/api/game/getdicgoods', tokenParser, controller.game.getDicGoods);
|
||||
router.post('/api/game/getdichero', tokenParser, controller.game.getDicHero);
|
||||
router.post('/api/game/getdicrmb', tokenParser, controller.game.getDicRMB);
|
||||
|
||||
@@ -38,6 +38,18 @@ export default class Game extends Service {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
public async getServerList() {
|
||||
const { ctx } = this;
|
||||
const { page, pageSize, sortField, sortOrder, id, serverId, name, groupName, groupId, serverType } = ctx.request.body;
|
||||
|
||||
const list = await ServerlistModel.findByCondition(page, pageSize, sortField, sortOrder, id, serverId, name, groupName, groupId, serverType);
|
||||
const total = await ServerlistModel.countByCondition( id, serverId, name, groupName, groupId, serverType)
|
||||
return ctx.service.utils.resResult(STATUS.SUCCESS, {
|
||||
list, total
|
||||
});
|
||||
}
|
||||
|
||||
public async getDicHero() {
|
||||
let list: DicHero[] = [];
|
||||
for(let [heroId, hero] of gameData.hero) {
|
||||
|
||||
Reference in New Issue
Block a user