后台:添加活动类型表
This commit is contained in:
@@ -25,4 +25,10 @@ export default class GameController extends Controller {
|
|||||||
ctx.body = await ctx.service.game.getDicRmb();
|
ctx.body = await ctx.service.game.getDicRmb();
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getDicActivityType() {
|
||||||
|
const { ctx } = this;
|
||||||
|
ctx.body = await ctx.service.game.getDicActivityType();
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export default (app: Application) => {
|
|||||||
router.post('/api/game/getserverlistbyenv', controller.game.getServerListByEnv);
|
router.post('/api/game/getserverlistbyenv', controller.game.getServerListByEnv);
|
||||||
router.post('/api/game/getdichero', controller.game.getDicHero);
|
router.post('/api/game/getdichero', controller.game.getDicHero);
|
||||||
router.post('/api/game/getdicrmb', controller.game.getDicRMB);
|
router.post('/api/game/getdicrmb', controller.game.getDicRMB);
|
||||||
|
router.post('/api/game/getdicactivitytype', controller.game.getDicActivityType);
|
||||||
|
|
||||||
router.post('/api/activity/getactivitylist', controller.activity.getActivityList);
|
router.post('/api/activity/getactivitylist', controller.activity.getActivityList);
|
||||||
router.post('/api/activity/updateactivity', controller.activity.updateActivity);
|
router.post('/api/activity/updateactivity', controller.activity.updateActivity);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { ServerlistModel } from '@db/Serverlist';
|
|||||||
import { gameData } from '@pubUtils/data';
|
import { gameData } from '@pubUtils/data';
|
||||||
import { DicHero } from '@pubUtils/dictionary/DicHero';
|
import { DicHero } from '@pubUtils/dictionary/DicHero';
|
||||||
import { DicRMB } from '@pubUtils/dictionary/DicRMB';
|
import { DicRMB } from '@pubUtils/dictionary/DicRMB';
|
||||||
|
import { DicActivityType } from '@pubUtils/dictionary/DicActivityType';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test Service
|
* Test Service
|
||||||
@@ -62,4 +63,10 @@ export default class Game extends Service {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async getDicActivityType() {
|
||||||
|
let list: DicActivityType[] = gameData.activityType;
|
||||||
|
return this.ctx.service.utils.resResult(STATUS.SUCCESS, {
|
||||||
|
list
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -434,7 +434,8 @@ export const FILENAME = {
|
|||||||
DIC_GACHA_CONTENT: 'dic_zyz_recruitContent',
|
DIC_GACHA_CONTENT: 'dic_zyz_recruitContent',
|
||||||
DIC_GIFT_PACKAGE: 'dic_zyz_giftPackage',
|
DIC_GIFT_PACKAGE: 'dic_zyz_giftPackage',
|
||||||
DIC_RECRUIT: 'dic_zyz_recruit',
|
DIC_RECRUIT: 'dic_zyz_recruit',
|
||||||
DIC_RMB: 'dic_zyz_rmb'
|
DIC_RMB: 'dic_zyz_rmb',
|
||||||
|
DIC_ACTIVITY_TYPE: 'dic_zyz_activityType'
|
||||||
}
|
}
|
||||||
|
|
||||||
export const WAR_RELATE_TABLES = [
|
export const WAR_RELATE_TABLES = [
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ import { dicGachaContent, dicGachaContentHero, loadGachaContent } from "./dictio
|
|||||||
import { dicGiftPackage, loadGiftPackage } from "./dictionary/DicGiftPackage";
|
import { dicGiftPackage, loadGiftPackage } from "./dictionary/DicGiftPackage";
|
||||||
import { dicRecruit, loadRecruit } from './dictionary/DicRecruit';
|
import { dicRecruit, loadRecruit } from './dictionary/DicRecruit';
|
||||||
import { loadRMB, dicRMB } from './dictionary/DicRMB';
|
import { loadRMB, dicRMB } from './dictionary/DicRMB';
|
||||||
|
import { dicActivityType, loadActivityType } from './dictionary/DicActivityType';
|
||||||
|
|
||||||
export const gameData = {
|
export const gameData = {
|
||||||
blurprtCompose: dicBlueprtCompose,
|
blurprtCompose: dicBlueprtCompose,
|
||||||
@@ -200,7 +201,8 @@ export const gameData = {
|
|||||||
giftPackage: dicGiftPackage,
|
giftPackage: dicGiftPackage,
|
||||||
comBtlLvRange: new Map<number, Array<number>>(),
|
comBtlLvRange: new Map<number, Array<number>>(),
|
||||||
recruit: dicRecruit,
|
recruit: dicRecruit,
|
||||||
rmb: dicRMB
|
rmb: dicRMB,
|
||||||
|
activityType: dicActivityType
|
||||||
};
|
};
|
||||||
|
|
||||||
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
// 在此提供一些原先在gamedata中提供的方法,以便更方便获取gameData数据
|
||||||
@@ -759,6 +761,7 @@ function loadDatas() {
|
|||||||
loadGiftPackage();
|
loadGiftPackage();
|
||||||
loadRecruit();
|
loadRecruit();
|
||||||
loadRMB();
|
loadRMB();
|
||||||
|
loadActivityType();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 重载dicParam
|
// 重载dicParam
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
import { readFileAndParse } from '../util'
|
||||||
|
import { FILENAME, ACTIVITY_TYPE } from '../../consts'
|
||||||
|
type KeysEnum<T> = { [P in keyof Required<T>]: true };
|
||||||
|
const _ = require('lodash');
|
||||||
|
|
||||||
|
export interface DicActivityType {
|
||||||
|
readonly id: number;
|
||||||
|
// 活动类型
|
||||||
|
readonly activityType: ACTIVITY_TYPE;
|
||||||
|
// 类型变量名
|
||||||
|
readonly name: string;
|
||||||
|
// 类型描述
|
||||||
|
readonly desc: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const DicActivityTypeKeys: KeysEnum<DicActivityType> = {
|
||||||
|
id: true,
|
||||||
|
activityType: true,
|
||||||
|
name: true,
|
||||||
|
desc: true,
|
||||||
|
};
|
||||||
|
|
||||||
|
export const dicActivityType = new Array<DicActivityType>();
|
||||||
|
export function loadActivityType() {
|
||||||
|
|
||||||
|
let arr = readFileAndParse(FILENAME.DIC_ACTIVITY_TYPE);
|
||||||
|
arr.forEach(o => {
|
||||||
|
o.desc = o.string;
|
||||||
|
dicActivityType.push(_.pick(o, Object.keys(DicActivityTypeKeys)));
|
||||||
|
});
|
||||||
|
arr = undefined;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user