后台:七天成长任务定制页面
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user