diff --git a/gm-server/app/controller/game.ts b/gm-server/app/controller/game.ts index 7ffcc62e4..e14af7c5b 100644 --- a/gm-server/app/controller/game.ts +++ b/gm-server/app/controller/game.ts @@ -13,4 +13,10 @@ export default class GameController extends Controller { ctx.body = await ctx.service.game.getServerListByEnv(); return } + + public async getDicHero() { + const { ctx } = this; + ctx.body = await ctx.service.game.getDicHero(); + return + } } diff --git a/gm-server/app/router.ts b/gm-server/app/router.ts index ed0bf7b56..c287f1691 100644 --- a/gm-server/app/router.ts +++ b/gm-server/app/router.ts @@ -45,6 +45,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/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 896e74408..06a5b2b5d 100644 --- a/gm-server/app/service/Game.ts +++ b/gm-server/app/service/Game.ts @@ -2,6 +2,8 @@ import { Service } from 'egg'; import { STATUS } from '@consts'; import { GameModel } from '@db/Game'; import { ServerlistModel } from '@db/Serverlist'; +import { gameData } from '@pubUtils/data'; +import { DicHero } from '@pubUtils/dictionary/DicHero'; /** * Test Service @@ -37,4 +39,16 @@ export default class Game extends Service { }); } + public async getDicHero() { + let list: DicHero[] = []; + for(let [heroId, hero] of gameData.hero) { + if(heroId <= 300) { + list.push(hero) + } + } + return this.ctx.service.utils.resResult(STATUS.SUCCESS, { + list + }) + } + } diff --git a/gm-server/app/service/users.ts b/gm-server/app/service/users.ts index df76ce465..2f44d0f07 100644 --- a/gm-server/app/service/users.ts +++ b/gm-server/app/service/users.ts @@ -270,6 +270,7 @@ export default class GMUsers extends Service { return ctx.service.utils.resResult(STATUS.SUCCESS, { uids }); } catch(e) { console.error(e.stack) + return ctx.service.utils.resResult(STATUS.GM_CREATE_ERROR, null, e.stack); } } diff --git a/shared/domain/activityField/dailyChallengesField.ts b/shared/domain/activityField/dailyChallengesField.ts index 24bad9d51..10543d8a3 100644 --- a/shared/domain/activityField/dailyChallengesField.ts +++ b/shared/domain/activityField/dailyChallengesField.ts @@ -2,7 +2,7 @@ import { TASK_TYPE, ACTIVITY_RESOURCES_TYPE } from '../../consts'; import { ActivityModelType } from '../../db/Activity'; import { ActivityDailyChallengesModelType } from '../../db/ActivityDailyChallenges'; import { RewardInter } from '../../pubUtils/interface'; -import { parseGoodStrWithType, parseHeroStrWithType, splitString } from '../../pubUtils/util'; +import { parseGoodStrWithType, parseHeroStrWithType } from '../../pubUtils/util'; import { CreateHeroParam } from '../roleField/hero'; import { ActivityBase } from './activityField'; diff --git a/shared/domain/activityField/growthField.ts b/shared/domain/activityField/growthField.ts index 41ced020a..d68f235e4 100644 --- a/shared/domain/activityField/growthField.ts +++ b/shared/domain/activityField/growthField.ts @@ -4,7 +4,7 @@ import { ActivityGrowthModelType } from '../../db/ActivityGrowth'; import { ActivityGrowthPointModelType } from '../../db/ActivityGrowthPoint'; import { RoleModel } from '../../db/Role'; import { RewardInter } from '../../pubUtils/interface'; -import { parseGoodStrWithType, parseHeroStrWithType, splitString } from '../../pubUtils/util'; +import { parseGoodStrWithType, parseHeroStrWithType } from '../../pubUtils/util'; import { CreateHeroParam } from '../roleField/hero'; import { ActivityBase } from './activityField';