后台:添加字典接口

This commit is contained in:
luying
2021-06-01 12:03:05 +08:00
parent bbdf484470
commit ec18b9734d
4 changed files with 21 additions and 2 deletions

View File

@@ -19,4 +19,10 @@ export default class GameController extends Controller {
ctx.body = await ctx.service.game.getDicHero();
return
}
public async getDicRMB() {
const { ctx } = this;
ctx.body = await ctx.service.game.getDicRmb();
return
}
}

View File

@@ -46,6 +46,7 @@ export default (app: Application) => {
router.post('/api/game/getserverenv', tokenParser, controller.game.getServerEnv);
router.post('/api/game/getserverlistbyenv', controller.game.getServerListByEnv);
router.post('/api/game/getdichero', controller.game.getDicHero);
router.post('/api/game/getdicrmb', controller.game.getDicRMB);
router.post('/api/activity/getactivitylist', controller.activity.getActivityList);
router.post('/api/activity/updateactivity', controller.activity.updateActivity);

View File

@@ -4,6 +4,7 @@ import { GameModel } from '@db/Game';
import { ServerlistModel } from '@db/Serverlist';
import { gameData } from '@pubUtils/data';
import { DicHero } from '@pubUtils/dictionary/DicHero';
import { DicRMB } from '@pubUtils/dictionary/DicRMB';
/**
* Test Service
@@ -51,4 +52,14 @@ export default class Game extends Service {
})
}
public async getDicRmb() {
let list: DicRMB[] = [];
for(let [_, dicRmb] of gameData.rmb) {
list.push(dicRmb);
}
return this.ctx.service.utils.resResult(STATUS.SUCCESS, {
list
})
}
}