Commit b0b39561 authored by maggie's avatar maggie

修改service编译方式

parent 59323d0c
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
"service": "task", "service": "task",
"function": "getItemListWithCollectStatus", "function": "getItemListWithCollectStatus",
"params": [ "params": [
{ "type": "var", "value": "commonBaseGetitemlistbyidsResult1" }, { "type": "var", "value": "commonBaseGetItemListByIdsResult1" },
{ "type": "var", "value": "userInfo" } { "type": "var", "value": "userInfo" }
], ],
"return": true "return": true
...@@ -333,7 +333,7 @@ ...@@ -333,7 +333,7 @@
"params": [ "params": [
{ "type": "var", "value": "context.data.startDay" }, { "type": "var", "value": "context.data.startDay" },
{ "type": "var", "value": "context.data.endDay" }, { "type": "var", "value": "context.data.endDay" },
{ "type": "var", "value": "commonStatGetstatsResult1" } { "type": "var", "value": "commonStatGetStatsResult1" }
], ],
"return": true "return": true
} }
...@@ -415,7 +415,7 @@ ...@@ -415,7 +415,7 @@
"params": [ "params": [
{ "type": "var", "value": "context.data.startDay" }, { "type": "var", "value": "context.data.startDay" },
{ "type": "var", "value": "context.data.endDay" }, { "type": "var", "value": "context.data.endDay" },
{ "type": "var", "value": "commonStatGetstatsResult1" } { "type": "var", "value": "commonStatGetStatsResult1" }
], ],
"return": true "return": true
} }
......
...@@ -6,11 +6,14 @@ const serverTemplatePath = 'templates' ...@@ -6,11 +6,14 @@ const serverTemplatePath = 'templates'
const controllerImport = (controller = {}) => { const controllerImport = (controller = {}) => {
const result = { const result = {
service: {} services: {}
} }
for (let fn in controller) { for (let fn in controller) {
for (let main of controller[fn].main) { for (let main of controller[fn].main) {
result.service[main.service] = true if (!result.services[main.type]) {
result.services[main.type] = {}
}
result.services[main.type][main.service] = true
} }
} }
console.log(result) console.log(result)
......
...@@ -12,6 +12,8 @@ export default { ...@@ -12,6 +12,8 @@ export default {
{{type}}{{controller | capitalize}}{{function | capitalize}}: {{type | capitalize}}{{controller | capitalize}}ControllerInstance.{{function}} {{type}}{{controller | capitalize}}{{function | capitalize}}: {{type | capitalize}}{{controller | capitalize}}ControllerInstance.{{function}}
{%-if loop.last-%}{%else%},{%-endif-%} {%-if loop.last-%}{%else%},{%-endif-%}
{%- endfor -%} {%- endfor -%}
{%-if loop.last-%}{%else%},{%-endif-%}
{%- endfor -%} {%- endfor -%}
{%-if loop.last-%}{%else%},{%-endif-%}
{%- endfor %} {%- endfor %}
} }
...@@ -6,10 +6,10 @@ import commonUtilCheck from '../../utils/common/check' ...@@ -6,10 +6,10 @@ import commonUtilCheck from '../../utils/common/check'
import commonUtilUpdate from '../../utils/common/update' import commonUtilUpdate from '../../utils/common/update'
import customDecorator from '../../decorator/custom' import customDecorator from '../../decorator/custom'
import customUtil from '../../utils/custom' import customUtil from '../../utils/custom'
import commonService from '../../service/common' {# import commonService from '../../service/common'
import customService from '../../service/custom' import customService from '../../service/custom' #}
import { resultsModel } from '../../sdk' import { resultsModel } from '../../sdk'
{# {{-macro.genControllerService(service)-}} #} {{-macro.genControllerService(services)-}}
export default class {{name | capitalize}}Controller { export default class {{name | capitalize}}Controller {
{%- for fn, item in model %} {%- for fn, item in model %}
......
{# 生成控制器引用的服务 #} {# 生成控制器引用的服务 #}
{% macro genControllerService(service)%} {% macro genControllerService(services)%}
import { {% for key, item in service %}{{key | capitalize}}Service{%- if loop.last %}{% else %}, {% endif %}{%- endfor %} } from '../../service' {% for type, type_item in services %}
import { {%for service, service_item in type_item %}{{type|capitalize}}{{service|capitalize}}Service{%- if loop.last %}{% else %}, {% endif %}{% endfor %} } from '../../service/{{type}}'
{% endfor%}
{% endmacro %} {% endmacro %}
{# 生成装饰器 #} {# 生成装饰器 #}
...@@ -20,7 +22,7 @@ import { {% for key, item in service %}{{key | capitalize}}Service{%- if loop.la ...@@ -20,7 +22,7 @@ import { {% for key, item in service %}{{key | capitalize}}Service{%- if loop.la
{% macro genServicesDecorator(mains) %} {% macro genServicesDecorator(mains) %}
{%- for type, type_item in mains | groupByTypeAndService -%} {%- for type, type_item in mains | groupByTypeAndService -%}
{%- for service, service_item in type_item -%} {%- for service, service_item in type_item -%}
{{type}}Service.{{service|capitalize}}Service{%- if loop.last %}{% else %}, {% endif %} {{type|capitalize}}{{service|capitalize}}Service{%- if loop.last %}{% else %}, {% endif %}
{%- endfor -%} {%- endfor -%}
{%- if loop.last %}{% else %}, {% endif %} {%- if loop.last %}{% else %}, {% endif %}
{%- endfor -%} {%- endfor -%}
...@@ -38,7 +40,7 @@ import { {% for key, item in service %}{{key | capitalize}}Service{%- if loop.la ...@@ -38,7 +40,7 @@ import { {% for key, item in service %}{{key | capitalize}}Service{%- if loop.la
]: [ ]: [
{%- for type, type_item in mains | groupByTypeAndService -%} {%- for type, type_item in mains | groupByTypeAndService -%}
{%- for service, service_item in type_item -%} {%- for service, service_item in type_item -%}
{{type}}Service.{{service|capitalize}}Service{%- if loop.last %}{% else %}, {% endif %} {{type|capitalize}}{{service|capitalize}}Service{%- if loop.last %}{% else %}, {% endif %}
{%- endfor -%} {%- endfor -%}
{%- if loop.last %}{% else %}, {% endif %} {%- if loop.last %}{% else %}, {% endif %}
{%- endfor -%} {%- endfor -%}
......
/** @format */ /** @format */
{%- for service, service_item in services %} {%- for service, service_item in services %}
import {{ service | capitalize }}Service from './{{ service }}.service' import Custom{{ service | capitalize }}Service from './{{ service }}.service'
{%- endfor %} {%- endfor %}
const common = { const custom = {
{%- for service, service_item in services %} {%- for service, service_item in services %}
{{ service | capitalize }}Service{% if loop.last %}{%else%},{% endif %} Custom{{ service | capitalize }}Service{% if loop.last %}{%else%},{% endif %}
{%- endfor %} {%- endfor %}
} }
export default common export default custom
export { export {
{%- for service, service_item in services %} {%- for service, service_item in services %}
{{ service | capitalize }}Service{% if loop.last %}{%else%},{% endif %} Custom{{ service | capitalize }}Service{% if loop.last %}{%else%},{% endif %}
{%- endfor %} {%- endfor %}
} }
...@@ -4,21 +4,21 @@ import commonUtilCheck from '../../utils/common/check' ...@@ -4,21 +4,21 @@ import commonUtilCheck from '../../utils/common/check'
import commonUtilUpdate from '../../utils/common/update' import commonUtilUpdate from '../../utils/common/update'
import customDecorator from '../../decorator/custom' import customDecorator from '../../decorator/custom'
import customUtil from '../../utils/custom' import customUtil from '../../utils/custom'
import commonService from '../../service/common'
import customService from '../../service/custom'
import { resultsModel } from '../../sdk' import { resultsModel } from '../../sdk'
import { CommonStatService } from '../../service/common'
export default class StatController { export default class StatController {
/** /**
* 增加埋点记录 * 增加埋点记录
*/ */
@commonDecorator.checkParams(['activityId', 'type']) @commonDecorator.checkParams(['activityId', 'type'])
@services([commonService.StatService]) @services([CommonStatService])
async addStat( async addStat(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos, { activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [commonService.StatService] [commonStatService]: [CommonStatService]
) { ) {
const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo) const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo)
return resultsModel.success({ return resultsModel.success({
...@@ -29,14 +29,14 @@ export default class StatController { ...@@ -29,14 +29,14 @@ export default class StatController {
* 统计数据 * 统计数据
*/ */
@commonDecorator.checkParams(['activityId', 'startDay', 'endDay']) @commonDecorator.checkParams(['activityId', 'startDay', 'endDay'])
@services([commonService.StatService]) @services([CommonStatService])
async getStats( async getStats(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos, { activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [commonService.StatService] [commonStatService]: [CommonStatService]
) { ) {
const commonStatGetStatsResult1 = await commonStatService.getStats(context.data.activityId, context.data.startDay, context.data.endDay) const commonStatGetStatsResult1 = await commonStatService.getStats(context.data.activityId, context.data.startDay, context.data.endDay)
const commonStatBuildExcelResult2 = await commonStatService.buildExcel(context.data.startDay, context.data.endDay, commonStatGetstatsResult1) const commonStatBuildExcelResult2 = await commonStatService.buildExcel(context.data.startDay, context.data.endDay, commonStatGetStatsResult1)
return resultsModel.success({ return resultsModel.success({
...commonStatBuildExcelResult2 ...commonStatBuildExcelResult2
}) })
......
...@@ -4,10 +4,10 @@ import commonUtilCheck from '../../utils/common/check' ...@@ -4,10 +4,10 @@ import commonUtilCheck from '../../utils/common/check'
import commonUtilUpdate from '../../utils/common/update' import commonUtilUpdate from '../../utils/common/update'
import customDecorator from '../../decorator/custom' import customDecorator from '../../decorator/custom'
import customUtil from '../../utils/custom' import customUtil from '../../utils/custom'
import commonService from '../../service/common'
import customService from '../../service/custom'
import { resultsModel } from '../../sdk' import { resultsModel } from '../../sdk'
import { CommonTaskService, CommonBaseService } from '../../service/common'
export default class TaskController { export default class TaskController {
/** /**
...@@ -17,11 +17,11 @@ export default class TaskController { ...@@ -17,11 +17,11 @@ export default class TaskController {
@commonDecorator.registeInfos(['vipInfo']) @commonDecorator.registeInfos(['vipInfo'])
@commonDecorator.preCheck([commonUtilCheck.checkActivityTime]) @commonDecorator.preCheck([commonUtilCheck.checkActivityTime])
@commonDecorator.preUpdate([commonUtilUpdate.updateVip, commonUtilUpdate.updateSignTask, commonUtilUpdate.updateOrderGoods]) @commonDecorator.preUpdate([commonUtilUpdate.updateVip, commonUtilUpdate.updateSignTask, commonUtilUpdate.updateOrderGoods])
@services([commonService.TaskService]) @services([CommonTaskService])
async getTaskList( async getTaskList(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo, vipInfo }: IControllerInfos, { activityInfo, userInfo, vipInfo }: IControllerInfos,
[commonTaskService]: [commonService.TaskService] [commonTaskService]: [CommonTaskService]
) { ) {
const commonTaskInitTaskResult1 = await commonTaskService.initTask(activityInfo, userInfo) const commonTaskInitTaskResult1 = await commonTaskService.initTask(activityInfo, userInfo)
return resultsModel.success({ return resultsModel.success({
...@@ -34,11 +34,11 @@ export default class TaskController { ...@@ -34,11 +34,11 @@ export default class TaskController {
@commonDecorator.checkParams(['activityId', 'taskType']) @commonDecorator.checkParams(['activityId', 'taskType'])
@commonDecorator.registeInfos(['session']) @commonDecorator.registeInfos(['session'])
@commonDecorator.preCheck([commonUtilCheck.checkActivityTime, commonUtilCheck.checkTaskLimit, commonUtilCheck.checkExchangeCreditsTask]) @commonDecorator.preCheck([commonUtilCheck.checkActivityTime, commonUtilCheck.checkTaskLimit, commonUtilCheck.checkExchangeCreditsTask])
@services([commonService.TaskService]) @services([CommonTaskService])
async doCompleteTask( async doCompleteTask(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo, session }: IControllerInfos, { activityInfo, userInfo, session }: IControllerInfos,
[commonTaskService]: [commonService.TaskService] [commonTaskService]: [CommonTaskService]
) { ) {
const commonTaskCompleteTaskResult1 = await commonTaskService.completeTask(context.data.taskType, activityInfo, userInfo) const commonTaskCompleteTaskResult1 = await commonTaskService.completeTask(context.data.taskType, activityInfo, userInfo)
return resultsModel.success({ return resultsModel.success({
...@@ -50,11 +50,11 @@ export default class TaskController { ...@@ -50,11 +50,11 @@ export default class TaskController {
*/ */
@commonDecorator.checkParams(['activityId', 'taskType', 'rewardsKey']) @commonDecorator.checkParams(['activityId', 'taskType', 'rewardsKey'])
@commonDecorator.preCheck([commonUtilCheck.checkActivityTime, commonUtilCheck.checkRemainTimes]) @commonDecorator.preCheck([commonUtilCheck.checkActivityTime, commonUtilCheck.checkRemainTimes])
@services([commonService.TaskService]) @services([CommonTaskService])
async receiveTaskRewards( async receiveTaskRewards(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos, { activityInfo, userInfo }: IControllerInfos,
[commonTaskService]: [commonService.TaskService] [commonTaskService]: [CommonTaskService]
) { ) {
const commonTaskReceiveTaskRewardsResult1 = await commonTaskService.receiveTaskRewards(context.data.taskType, context.data.rewardsKey, userInfo) const commonTaskReceiveTaskRewardsResult1 = await commonTaskService.receiveTaskRewards(context.data.taskType, context.data.rewardsKey, userInfo)
return resultsModel.success({ return resultsModel.success({
...@@ -66,14 +66,14 @@ export default class TaskController { ...@@ -66,14 +66,14 @@ export default class TaskController {
*/ */
@commonDecorator.checkParams(['activityId', 'itemIds']) @commonDecorator.checkParams(['activityId', 'itemIds'])
@commonDecorator.registeInfos(['session']) @commonDecorator.registeInfos(['session'])
@services([commonService.BaseService, commonService.TaskService]) @services([CommonBaseService, CommonTaskService])
async getCollectGoodsList( async getCollectGoodsList(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo, session }: IControllerInfos, { activityInfo, userInfo, session }: IControllerInfos,
[commonBaseService, commonTaskService]: [commonService.BaseService, commonService.TaskService] [commonBaseService, commonTaskService]: [CommonBaseService, CommonTaskService]
) { ) {
const commonBaseGetItemListByIdsResult1 = await commonBaseService.getItemListByIds(context.data.itemIds, session) const commonBaseGetItemListByIdsResult1 = await commonBaseService.getItemListByIds(context.data.itemIds, session)
const commonTaskGetItemListWithCollectStatusResult2 = await commonTaskService.getItemListWithCollectStatus(commonBaseGetitemlistbyidsResult1, userInfo) const commonTaskGetItemListWithCollectStatusResult2 = await commonTaskService.getItemListWithCollectStatus(commonBaseGetItemListByIdsResult1, userInfo)
return resultsModel.success({ return resultsModel.success({
...commonTaskGetItemListWithCollectStatusResult2 ...commonTaskGetItemListWithCollectStatusResult2
}) })
......
...@@ -4,10 +4,10 @@ import commonUtilCheck from '../../utils/common/check' ...@@ -4,10 +4,10 @@ import commonUtilCheck from '../../utils/common/check'
import commonUtilUpdate from '../../utils/common/update' import commonUtilUpdate from '../../utils/common/update'
import customDecorator from '../../decorator/custom' import customDecorator from '../../decorator/custom'
import customUtil from '../../utils/custom' import customUtil from '../../utils/custom'
import commonService from '../../service/common'
import customService from '../../service/custom'
import { resultsModel } from '../../sdk' import { resultsModel } from '../../sdk'
import { CommonUserService } from '../../service/common'
export default class UserController { export default class UserController {
/** /**
...@@ -15,11 +15,11 @@ export default class UserController { ...@@ -15,11 +15,11 @@ export default class UserController {
*/ */
@commonDecorator.checkParams(['activityId']) @commonDecorator.checkParams(['activityId'])
@commonDecorator.registeInfos(['session']) @commonDecorator.registeInfos(['session'])
@services([commonService.UserService]) @services([CommonUserService])
async getVipInfo( async getVipInfo(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo, session }: IControllerInfos, { activityInfo, userInfo, session }: IControllerInfos,
[commonUserService]: [commonService.UserService] [commonUserService]: [CommonUserService]
) { ) {
const commonUserGetShopVipResult1 = await commonUserService.getShopVip(context, session) const commonUserGetShopVipResult1 = await commonUserService.getShopVip(context, session)
return resultsModel.success({ return resultsModel.success({
...@@ -30,11 +30,11 @@ export default class UserController { ...@@ -30,11 +30,11 @@ export default class UserController {
* 获取排行榜 * 获取排行榜
*/ */
@commonDecorator.checkParams(['activityId', 'key', 'timeKey', 'limit']) @commonDecorator.checkParams(['activityId', 'key', 'timeKey', 'limit'])
@services([commonService.UserService]) @services([CommonUserService])
async getRankList( async getRankList(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos, { activityInfo, userInfo }: IControllerInfos,
[commonUserService]: [commonService.UserService] [commonUserService]: [CommonUserService]
) { ) {
const commonUserGetMyRankInfoResult1 = await commonUserService.getMyRankInfo(context.data.key, context.data.timeKey, userInfo) const commonUserGetMyRankInfoResult1 = await commonUserService.getMyRankInfo(context.data.key, context.data.timeKey, userInfo)
const commonUserGetRankResult2 = await commonUserService.getRank(context.data.key, context.data.timeKey, context.data.limit) const commonUserGetRankResult2 = await commonUserService.getRank(context.data.key, context.data.timeKey, context.data.limit)
......
...@@ -4,10 +4,12 @@ import commonUtilCheck from '../../utils/common/check' ...@@ -4,10 +4,12 @@ import commonUtilCheck from '../../utils/common/check'
import commonUtilUpdate from '../../utils/common/update' import commonUtilUpdate from '../../utils/common/update'
import customDecorator from '../../decorator/custom' import customDecorator from '../../decorator/custom'
import customUtil from '../../utils/custom' import customUtil from '../../utils/custom'
import commonService from '../../service/common'
import customService from '../../service/custom'
import { resultsModel } from '../../sdk' import { resultsModel } from '../../sdk'
import { CommonStatService } from '../../service/common'
import { CustomTestService } from '../../service/custom'
export default class Test1Controller { export default class Test1Controller {
/** /**
...@@ -15,11 +17,11 @@ export default class Test1Controller { ...@@ -15,11 +17,11 @@ export default class Test1Controller {
*/ */
@commonDecorator.checkParams(['activityId', 'type']) @commonDecorator.checkParams(['activityId', 'type'])
@customDecorator.test1(['tt']) @customDecorator.test1(['tt'])
@services([commonService.StatService, customService.TestService]) @services([CommonStatService, CustomTestService])
async addStat( async addStat(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos, { activityInfo, userInfo }: IControllerInfos,
[commonStatService, customTestService]: [commonService.StatService, customService.TestService] [commonStatService, customTestService]: [CommonStatService, CustomTestService]
) { ) {
const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo) const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo)
const customTestTest1Result2 = await customTestService.test1() const customTestTest1Result2 = await customTestService.test1()
...@@ -32,11 +34,11 @@ export default class Test1Controller { ...@@ -32,11 +34,11 @@ export default class Test1Controller {
* 统计数据 * 统计数据
*/ */
@commonDecorator.checkParams(['activityId', 'startDay', 'endDay']) @commonDecorator.checkParams(['activityId', 'startDay', 'endDay'])
@services([commonService.StatService]) @services([CommonStatService])
async getStats( async getStats(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos, { activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [commonService.StatService] [commonStatService]: [CommonStatService]
) { ) {
const commonStatGetStatsResult1 = await commonStatService.getStats(context.data.activityId, context.data.startDay, context.data.endDay) const commonStatGetStatsResult1 = await commonStatService.getStats(context.data.activityId, context.data.startDay, context.data.endDay)
const commonStatBuildExcelResult2 = await commonStatService.buildExcel(context.data.startDay, context.data.endDay, commonStatGetStatsResult1) const commonStatBuildExcelResult2 = await commonStatService.buildExcel(context.data.startDay, context.data.endDay, commonStatGetStatsResult1)
......
...@@ -4,21 +4,21 @@ import commonUtilCheck from '../../utils/common/check' ...@@ -4,21 +4,21 @@ import commonUtilCheck from '../../utils/common/check'
import commonUtilUpdate from '../../utils/common/update' import commonUtilUpdate from '../../utils/common/update'
import customDecorator from '../../decorator/custom' import customDecorator from '../../decorator/custom'
import customUtil from '../../utils/custom' import customUtil from '../../utils/custom'
import commonService from '../../service/common'
import customService from '../../service/custom'
import { resultsModel } from '../../sdk' import { resultsModel } from '../../sdk'
import { CommonStatService } from '../../service/common'
export default class Test2Controller { export default class Test2Controller {
/** /**
* 增加埋点记录 * 增加埋点记录
*/ */
@commonDecorator.checkParams(['activityId', 'type']) @commonDecorator.checkParams(['activityId', 'type'])
@services([commonService.StatService]) @services([CommonStatService])
async addStat( async addStat(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos, { activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [commonService.StatService] [commonStatService]: [CommonStatService]
) { ) {
const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo) const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo)
return resultsModel.success({ return resultsModel.success({
...@@ -29,11 +29,11 @@ export default class Test2Controller { ...@@ -29,11 +29,11 @@ export default class Test2Controller {
* 统计数据 * 统计数据
*/ */
@commonDecorator.checkParams(['activityId', 'startDay', 'endDay']) @commonDecorator.checkParams(['activityId', 'startDay', 'endDay'])
@services([commonService.StatService]) @services([CommonStatService])
async getStats( async getStats(
context: IContext<IParams>, context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos, { activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [commonService.StatService] [commonStatService]: [CommonStatService]
) { ) {
const commonStatGetStatsResult1 = await commonStatService.getStats(context.data.activityId, context.data.startDay, context.data.endDay) const commonStatGetStatsResult1 = await commonStatService.getStats(context.data.activityId, context.data.startDay, context.data.endDay)
const commonStatBuildExcelResult2 = await commonStatService.buildExcel(context.data.startDay, context.data.endDay, commonStatGetstatsResult1) const commonStatBuildExcelResult2 = await commonStatService.buildExcel(context.data.startDay, context.data.endDay, commonStatGetstatsResult1)
......
/** @format */
import UserController from './controller/user.controller' import CommonUserController from './controller/common/user.controller'
import TaskController from './controller/task.controller' const CommonUserControllerInstance = new CommonUserController()
import BaseController from './controller/base.controller' import CommonTaskController from './controller/common/task.controller'
import AwardsController from './controller/awards.controller' const CommonTaskControllerInstance = new CommonTaskController()
import ShareController from './controller/share.controller' import CommonStatController from './controller/common/stat.controller'
import StatController from './controller/stat.controller' const CommonStatControllerInstance = new CommonStatController()
import LoginController from './controller/login.controller' import CustomTest1Controller from './controller/custom/test1.controller'
import GameController from './controller/game.controller' const CustomTest1ControllerInstance = new CustomTest1Controller()
import CustomTest2Controller from './controller/custom/test2.controller'
const { getVipInfo, getRankList } = new UserController() const CustomTest2ControllerInstance = new CustomTest2Controller()
const { login } = new LoginController()
const { getGameInfo, startGame, submitGame } = new GameController()
const {
getTaskList,
receiveTaskRewards,
doCompleteTask,
getCollectGoodsList // 获取收藏商品列表,包含收藏状态
} = new TaskController()
const { getActivityBaseInfoById, getItemListByItemIds } = new BaseController()
const { getMyPrizeList, receiveObjectPrize, receiveEnamePrize, drawLotteryPrize } = new AwardsController()
const { doHelp } = new ShareController()
const { getStats, addStat } = new StatController()
export default { export default {
login, commonUserGetvipinfo: CommonUserControllerInstance.getVipInfo,
getVipInfo, commonUserGetranklist: CommonUserControllerInstance.getRankList,
getTaskList, commonTaskGettasklist: CommonTaskControllerInstance.getTaskList,
doCompleteTask, commonTaskDocompletetask: CommonTaskControllerInstance.doCompleteTask,
receiveTaskRewards, commonTaskReceivetaskrewards: CommonTaskControllerInstance.receiveTaskRewards,
getActivityBaseInfoById, commonTaskGetcollectgoodslist: CommonTaskControllerInstance.getCollectGoodsList,
getMyPrizeList, commonStatAddstat: CommonStatControllerInstance.addStat,
receiveObjectPrize, commonStatGetstats: CommonStatControllerInstance.getStats,
receiveEnamePrize, customTest1Addstat: CustomTest1ControllerInstance.addStat,
doHelp, customTest1Getstats: CustomTest1ControllerInstance.getStats,
getStats, customTest2Addstat: CustomTest2ControllerInstance.addStat,
addStat, customTest2Getstats: CustomTest2ControllerInstance.getStats
getRankList,
// 游戏类
getGameInfo,
startGame,
submitGame
} }
/** @format */ /** @format */
import TestService from './test.service' import CustomTestService from './test.service'
const common = { const custom = {
TestService CustomTestService
} }
export default common export default custom
export { export {
TestService CustomTestService
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment