diff --git a/gm-server/app/controller/game.ts b/gm-server/app/controller/game.ts index e14af7c5b..448125cf7 100644 --- a/gm-server/app/controller/game.ts +++ b/gm-server/app/controller/game.ts @@ -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 + } } diff --git a/gm-server/app/router.ts b/gm-server/app/router.ts index ac6d82045..551d1f2bb 100644 --- a/gm-server/app/router.ts +++ b/gm-server/app/router.ts @@ -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); diff --git a/gm-server/app/service/Game.ts b/gm-server/app/service/Game.ts index 06a5b2b5d..d32cc652a 100644 --- a/gm-server/app/service/Game.ts +++ b/gm-server/app/service/Game.ts @@ -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 + }) + } + } diff --git a/shared/pubUtils/data.ts b/shared/pubUtils/data.ts index 20e353c69..05983c2e4 100644 --- a/shared/pubUtils/data.ts +++ b/shared/pubUtils/data.ts @@ -81,7 +81,7 @@ import { dicGacha, loadGacha } from "./dictionary/DicGacha"; import { dicGachaContent, dicGachaContentHero, loadGachaContent } from "./dictionary/DicGachaContent"; import { dicGiftPackage, loadGiftPackage } from "./dictionary/DicGiftPackage"; import { dicRecruit, loadRecruit } from './dictionary/DicRecruit'; -import { loadRMB } from './dictionary/DicRMB'; +import { loadRMB, dicRMB } from './dictionary/DicRMB'; export const gameData = { blurprtCompose: dicBlueprtCompose, @@ -199,7 +199,8 @@ export const gameData = { heroTransPiece: new Map(), giftPackage: dicGiftPackage, comBtlLvRange: new Map>(), - recruit: dicRecruit + recruit: dicRecruit, + rmb: dicRMB }; // 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据