Commit 3ab1ec49 authored by qinhaitao's avatar qinhaitao

refactor: 💡 格式优化

parent 3f53f8e9
/** @format */
import { services, checkParams, noCheckUser } from '../../decorator/common'
import { services,checkParams,noCheckUser } from '../../decorator/common'
import customUtil from '../../utils/custom'
import { resultsModel } from '../../sdk'
import { CommonBaseService } from '../../service/common'
export default class BaseController {
/**
* 活动基本信息
......@@ -14,7 +18,7 @@ export default class BaseController {
async getActivityBaseInfoById(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonBaseService]: [CommonBaseService]
[commonBaseService]: [CommonBaseService],
) {
const commonBaseGetBaseInfoResult1 = await commonBaseService.getBaseInfo(context.data.activityId)
return resultsModel.success({
......
/** @format */
import { services, checkParams, noCheckUser, registeInfos } from '../../decorator/common'
import { services,checkParams,noCheckUser,registeInfos } from '../../decorator/common'
import customUtil from '../../utils/custom'
import { resultsModel } from '../../sdk'
import { CommonUserService, CommonAccessService } from '../../service/common'
export default class LoginController {
/**
* 登录接口, 初始化/更新用户信息
......@@ -15,7 +19,7 @@ export default class LoginController {
async login(
context: IContext<IParams>,
{ activityInfo, userInfo, vipInfo }: IControllerInfos,
[commonUserService, commonAccessService]: [CommonUserService, CommonAccessService]
[commonUserService, commonAccessService]: [CommonUserService, CommonAccessService],
) {
const commonUserDoLoginResult1 = await commonUserService.doLogin(userInfo, vipInfo, activityInfo)
const commonAccessAddAccessResult2 = await commonAccessService.addAccess(commonUserDoLoginResult1, vipInfo)
......
/** @format */
import { services, checkParams, registeInfos, preCheck } from '../../decorator/common'
import { checkActivityTime, checkInviteId, checkNewVip, checkHelpRecord } from '../../utils/common/check'
import { services,checkParams,registeInfos,preCheck } from '../../decorator/common'
import { checkActivityTime,checkInviteId,checkNewVip,checkHelpRecord } from '../../utils/common/check'
import customUtil from '../../utils/custom'
import { resultsModel } from '../../sdk'
import { CommonUserService, CommonTaskService, CommonStatService } from '../../service/common'
export default class ShareController {
/**
* 获取邀请信息
......@@ -14,13 +18,9 @@ export default class ShareController {
async getShareInfo(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonUserService]: [CommonUserService]
[commonUserService]: [CommonUserService],
) {
const commonUserQueryDataByKeyResult1 = await commonUserService.queryDataByKey(
'remainTimes.invites',
userInfo,
'rewards'
)
const commonUserQueryDataByKeyResult1 = await commonUserService.queryDataByKey('remainTimes.invites', userInfo, 'rewards')
return resultsModel.success({
...commonUserQueryDataByKeyResult1
})
......
/** @format */
import { services, checkParams } from '../../decorator/common'
import { services,checkParams } from '../../decorator/common'
import customUtil from '../../utils/custom'
import { resultsModel } from '../../sdk'
import { CommonStatService } from '../../service/common'
export default class StatController {
/**
* 增加埋点记录
......@@ -13,7 +17,7 @@ export default class StatController {
async addStat(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [CommonStatService]
[commonStatService]: [CommonStatService],
) {
const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo)
return resultsModel.success({
......@@ -28,18 +32,10 @@ export default class StatController {
async getStats(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [CommonStatService]
[commonStatService]: [CommonStatService],
) {
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 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)
return resultsModel.success({
...commonStatBuildExcelResult2
})
......
/** @format */
import { services, checkParams, registeInfos, preCheck, preUpdate } from '../../decorator/common'
import {
checkActivityTime,
checkTaskLimit,
checkExchangeCreditsTask,
checkUserInfo,
checkRemainTimes
} from '../../utils/common/check'
import { updateVip, updateSignTask, updateOrderGoods } from '../../utils/common/update'
import { services,checkParams,registeInfos,preCheck,preUpdate } from '../../decorator/common'
import { checkActivityTime,checkTaskLimit,checkExchangeCreditsTask,checkUserInfo,checkRemainTimes } from '../../utils/common/check'
import { updateVip,updateSignTask,updateOrderGoods } from '../../utils/common/update'
import customUtil from '../../utils/custom'
import { resultsModel } from '../../sdk'
import { CommonTaskService, CommonBaseService } from '../../service/common'
export default class TaskController {
/**
* 任务列表
......@@ -24,7 +22,7 @@ export default class TaskController {
async getTaskList(
context: IContext<IParams>,
{ activityInfo, userInfo, vipInfo }: IControllerInfos,
[commonTaskService]: [CommonTaskService]
[commonTaskService]: [CommonTaskService],
) {
const commonTaskInitTaskListResult1 = await commonTaskService.initTaskList(userInfo, activityInfo)
return resultsModel.success({
......@@ -41,13 +39,9 @@ export default class TaskController {
async doCompleteTask(
context: IContext<IParams>,
{ activityInfo, userInfo, session }: IControllerInfos,
[commonTaskService]: [CommonTaskService]
[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({
...commonTaskCompleteTaskResult1
})
......@@ -61,13 +55,9 @@ export default class TaskController {
async receiveTaskRewards(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonTaskService]: [CommonTaskService]
[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({
...commonTaskReceiveTaskRewardsResult1
})
......@@ -81,13 +71,10 @@ export default class TaskController {
async getCollectGoodsList(
context: IContext<IParams>,
{ activityInfo, userInfo, session }: IControllerInfos,
[commonBaseService, commonTaskService]: [CommonBaseService, CommonTaskService]
[commonBaseService, commonTaskService]: [CommonBaseService, CommonTaskService],
) {
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({
...commonTaskGetItemListWithCollectStatusResult2
})
......
/** @format */
import { services, checkParams } from '../../decorator/common'
import { services,checkParams } from '../../decorator/common'
import customUtil from '../../utils/custom'
import { resultsModel } from '../../sdk'
import { CommonUserService } from '../../service/common'
export default class UserController {
/**
* 获取会员信息
......@@ -13,7 +17,7 @@ export default class UserController {
async getVipInfo(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonUserService]: [CommonUserService]
[commonUserService]: [CommonUserService],
) {
const commonUserGetShopVipResult1 = await commonUserService.getShopVip(context, activityInfo)
return resultsModel.success({
......@@ -28,18 +32,10 @@ export default class UserController {
async getRankList(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonUserService]: [CommonUserService]
[commonUserService]: [CommonUserService],
) {
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 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)
return resultsModel.success({
...commonUserGetMyRankInfoResult1,
...commonUserGetRankResult2
......
/** @format */
import { services, checkParams } from '../../decorator/common'
import { services,checkParams } from '../../decorator/common'
import { test1 } from '../../decorator/custom'
import customUtil from '../../utils/custom'
import { resultsModel } from '../../sdk'
import { CommonStatService } from '../../service/common'
import { CustomTestService } from '../../service/custom'
export default class Test1Controller {
/**
* 增加埋点记录
......@@ -16,7 +20,7 @@ export default class Test1Controller {
async testAddStat(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonStatService, customTestService]: [CommonStatService, CustomTestService]
[commonStatService, customTestService]: [CommonStatService, CustomTestService],
) {
const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo)
const customTestTest1Result2 = await customTestService.test1()
......@@ -33,18 +37,10 @@ export default class Test1Controller {
async testGetStats(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [CommonStatService]
[commonStatService]: [CommonStatService],
) {
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 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)
return resultsModel.success({
...commonStatBuildExcelResult2
})
......
/** @format */
import { services, checkParams, preUpdate } from '../../decorator/common'
import { updateVip, updateSignTask, updateOrderGoods } from '../../utils/common/update'
import { services,checkParams,preUpdate } from '../../decorator/common'
import { updateVip,updateSignTask,updateOrderGoods } from '../../utils/common/update'
import customUtil from '../../utils/custom'
import { resultsModel } from '../../sdk'
import { CommonStatService } from '../../service/common'
export default class Test2Controller {
/**
* 增加埋点记录
......@@ -14,7 +18,7 @@ export default class Test2Controller {
async test2addStat(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [CommonStatService]
[commonStatService]: [CommonStatService],
) {
const commonStatAddStatResult1 = await commonStatService.addStat(context.data.type, userInfo)
return resultsModel.success({
......@@ -30,18 +34,10 @@ export default class Test2Controller {
async test2getStats(
context: IContext<IParams>,
{ activityInfo, userInfo }: IControllerInfos,
[commonStatService]: [CommonStatService]
[commonStatService]: [CommonStatService],
) {
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 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)
return resultsModel.success({
...commonStatBuildExcelResult2
})
......
......@@ -8,4 +8,6 @@ const custom = {
export default custom
export { test1 }
export {
test1
}
......@@ -7,4 +7,6 @@ const custom = {
export default custom
export { CustomTestService }
export {
CustomTestService
}
/** @format */
const custom = {}
const custom = {
}
export default custom
export {}
export {
}
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