Commit 76c36558 authored by maggie's avatar maggie

代码迁移

parent 3c47a8d2
......@@ -36,6 +36,11 @@ const customFileMap = (controllers = {}) => {
}
}
}
for (let main of controllers[controllerType][controller][fn].main) {
if (main.type === 'custom') {
result.services[main.name] = true
}
}
}
}
}
......@@ -44,7 +49,7 @@ const customFileMap = (controllers = {}) => {
const run = async (gulp, nunjucksRender, rename, nunjucksRenderConfig) => {
//编译自定义文件
const { decorators, utils } = customFileMap(config.controllers)
const { decorators, utils, services } = customFileMap(config.controllers)
for (let decorator in decorators) {
await gulp
.src(`${serverTemplatePath}/decorator.njk`)
......
......@@ -4,17 +4,17 @@ import commonUtilCheck from '../../utils/common/check'
import commonUtilUpdate from '../../utils/common/update'
import customDecorator from '../../decorator/custom'
import { resultsModel } from '../../sdk'
import { StatService } from '../../service'
import commonService, { StatService } from '../../service/common'
export default class StatController {
/**
* 增加埋点记录
*/
@commonDecorator.checkParams(['activityId', 'type'])
@services([StatService])
@services([commonService.StatService])
async addStat(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[statService]: [StatService]
[statService]: [commonService.StatService]
) {
const commonStatAddstatResult1 = await statService.addStat(context.data.type, userInfo)
return resultsModel.success({
......
......@@ -4,9 +4,9 @@
* @format
*/
import { BaseDao } from '../sdk'
import { getToday } from '../utils'
import { ACCESS_DB_NAME } from '../db'
import { BaseDao } from '../../sdk'
import { getToday } from '../../utils'
import { ACCESS_DB_NAME } from '../../db'
export default class UserAccessService {
context: IContext<IParams>
......
......@@ -4,7 +4,7 @@
* @format
*/
import { BaseDao, resultsModel } from '../sdk'
import { BaseDao, resultsModel } from '../../sdk'
import UserService from './user.service'
import {
CODE_TYPES,
......@@ -14,11 +14,11 @@ import {
DELETE_STATUS,
SWICH_TOCK,
SHIP_STATUS
} from '../constants'
import { AWARDS_DB_NAME, PRIZE_CONFIG_DB_NAME } from '../db'
import { sendTBAward, getSellerSession, rand } from '../utils'
import { generateCodeTypeWithMsg } from '../utils/common/helper'
import { getToday } from '../utils/common/getToday'
} from '../../constants'
import { AWARDS_DB_NAME, PRIZE_CONFIG_DB_NAME } from '../../db'
import { sendTBAward, getSellerSession, rand } from '../../utils'
import { generateCodeTypeWithMsg } from '../../utils/common/helper'
import { getToday } from '../../utils/common/getToday'
export default class AwardsService extends UserService {
awardsdao: IBaseDao
......
......@@ -4,9 +4,9 @@
* @format
*/
import { BaseDao, TBAPIS } from '../sdk'
import { ACTIVITY_CONFIG_DB_NAME } from '../db'
import { ACTIVITY_STATUS } from '../constants'
import { BaseDao, TBAPIS } from '../../sdk'
import { ACTIVITY_CONFIG_DB_NAME } from '../../db'
import { ACTIVITY_STATUS } from '../../constants'
export default class BaseService {
context: IContext<any>
......
......@@ -4,10 +4,10 @@
* @format
*/
import { BaseDao, TBAPIS } from '../sdk'
import { JOIN_DB_NAME } from '../db'
import { ACTIVITY_STATUS } from '../constants'
import { getToday } from '../utils'
import { BaseDao, TBAPIS } from '../../sdk'
import { JOIN_DB_NAME } from '../../db'
import { ACTIVITY_STATUS } from '../../constants'
import { getToday } from '../../utils'
export default class GameService {
context: IContext<IParams>
......
/** @format */
import AccessService from './access.service'
import BaseService from './base.service'
import UserService from './user.service'
import AwardsService from './awards.service'
import TaskService from './task.service'
import StatService from './stat.service'
import GameService from './game.service'
const common = {
AccessService,
BaseService,
UserService,
AwardsService,
TaskService,
StatService,
GameService
}
export default common
export {
AccessService,
BaseService,
UserService,
AwardsService,
TaskService,
StatService,
GameService
}
......@@ -4,11 +4,11 @@
* @format
*/
import { BaseDao, dateFormatter, transformBeijingDate } from '../sdk'
import { STAT_DB_NAME, ACCESS_DB_NAME, USER_DB_NAME, AWARDS_DB_NAME } from '../db'
import { BaseDao, dateFormatter, transformBeijingDate } from '../../sdk'
import { STAT_DB_NAME, ACCESS_DB_NAME, USER_DB_NAME, AWARDS_DB_NAME } from '../../db'
import * as xlsx from 'node-xlsx'
import { getToday } from '../utils'
import { STAT_TYPE } from '../constants'
import { getToday } from '../../utils'
import { STAT_TYPE } from '../../constants'
export default class StatService {
context: IContext<any>
......
......@@ -5,10 +5,10 @@
*/
import UserService from './user.service'
import { getToday, getUserOrderlist, generateVipUrl, formatVipCbUrl } from '../utils'
import { TASK_RATE_TYPE, TASK_STATUS } from '../constants'
import { getTodayCompleteTask, getTotalCompleteTask, setTaskStatus } from '../utils/common/task'
import { CODE_TYPES } from '../errorCode'
import { getToday, getUserOrderlist, generateVipUrl, formatVipCbUrl } from '../../utils'
import { TASK_RATE_TYPE, TASK_STATUS } from '../../constants'
import { getTodayCompleteTask, getTotalCompleteTask, setTaskStatus } from '../../utils/common/task'
import { CODE_TYPES } from '../../errorCode'
export interface ITaskInfo {
taskType?: string // 任务类型
......
......@@ -4,13 +4,13 @@
* @format
*/
import { BaseDao } from '../sdk'
import { BaseDao } from '../../sdk'
import BaseService from './base.service'
import { USER_DB_NAME } from '../db'
import { getToday, formatUpdateUserProjection } from '../utils'
import { isNewVip } from '../utils/common/userUpdate'
import { formatUserNick, formatUpdatedDataByProjection } from '../utils/common/format'
import { getShopVip, formatVipCbUrl } from '../utils/common/vip'
import { USER_DB_NAME } from '../../db'
import { getToday, formatUpdateUserProjection } from '../../utils'
import { isNewVip } from '../../utils/common/userUpdate'
import { formatUserNick, formatUpdatedDataByProjection } from '../../utils/common/format'
import { getShopVip, formatVipCbUrl } from '../../utils/common/vip'
class UserService extends BaseService {
userdao: IBaseDao
constructor(context: IContext<IParams>) {
......
/** @format */
export { default as AccessService } from './access.service'
export { default as BaseService } from './base.service'
export { default as UserService } from './user.service'
export { default as AwardsService } from './awards.service'
export { default as TaskService } from './task.service'
export { default as StatService } from './stat.service'
export { default as GameService } from './game.service'
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