Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qinhaitao
taobao-mini-template
Commits
76c36558
Commit
76c36558
authored
Nov 09, 2020
by
maggie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码迁移
parent
3c47a8d2
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
70 additions
and
43 deletions
+70
-43
generate.js
v2.0/compileServer/generate.js
+6
-1
stat.controller.ts
v2.0/src/controller/common/stat.controller.ts
+3
-3
access.service.ts
v2.0/src/service/common/access.service.ts
+3
-3
awards.service.ts
v2.0/src/service/common/awards.service.ts
+6
-6
base.service.ts
v2.0/src/service/common/base.service.ts
+3
-3
game.service.ts
v2.0/src/service/common/game.service.ts
+4
-4
index.ts
v2.0/src/service/common/index.ts
+31
-0
stat.service.ts
v2.0/src/service/common/stat.service.ts
+4
-4
task.service.ts
v2.0/src/service/common/task.service.ts
+4
-4
user.service.ts
v2.0/src/service/common/user.service.ts
+6
-6
index.ts
v2.0/src/service/index.ts
+0
-9
No files found.
v2.0/compileServer/generate.js
View file @
76c36558
...
...
@@ -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`
)
...
...
v2.0/src/controller/common/stat.controller.ts
View file @
76c36558
...
...
@@ -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
({
...
...
v2.0/src/service/access.service.ts
→
v2.0/src/service/
common/
access.service.ts
View file @
76c36558
...
...
@@ -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
>
...
...
v2.0/src/service/awards.service.ts
→
v2.0/src/service/
common/
awards.service.ts
View file @
76c36558
...
...
@@ -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
...
...
v2.0/src/service/base.service.ts
→
v2.0/src/service/
common/
base.service.ts
View file @
76c36558
...
...
@@ -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
>
...
...
v2.0/src/service/game.service.ts
→
v2.0/src/service/
common/
game.service.ts
View file @
76c36558
...
...
@@ -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
>
...
...
v2.0/src/service/common/index.ts
0 → 100644
View file @
76c36558
/** @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
}
v2.0/src/service/stat.service.ts
→
v2.0/src/service/
common/
stat.service.ts
View file @
76c36558
...
...
@@ -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
>
...
...
v2.0/src/service/task.service.ts
→
v2.0/src/service/
common/
task.service.ts
View file @
76c36558
...
...
@@ -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
// 任务类型
...
...
v2.0/src/service/user.service.ts
→
v2.0/src/service/
common/
user.service.ts
View file @
76c36558
...
...
@@ -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
>
)
{
...
...
v2.0/src/service/index.ts
deleted
100644 → 0
View file @
3c47a8d2
/** @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'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment