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
4277e2f2
Commit
4277e2f2
authored
Nov 11, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
export
parent
67fec37f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
29 deletions
+30
-29
config.json
v2.0/compileServer/config.json
+4
-4
controller.export.njk
v2.0/compileServer/templates/controller.export.njk
+1
-1
test1.controller.ts
v2.0/src/controller/custom/test1.controller.ts
+2
-2
test2.controller.ts
v2.0/src/controller/custom/test2.controller.ts
+2
-2
index.ts
v2.0/src/index.ts
+21
-20
No files found.
v2.0/compileServer/config.json
View file @
4277e2f2
...
@@ -656,7 +656,7 @@
...
@@ -656,7 +656,7 @@
},
},
"custom"
:
{
"custom"
:
{
"test1"
:
{
"test1"
:
{
"
a
ddStat"
:
{
"
testA
ddStat"
:
{
"desc"
:
"增加埋点记录"
,
"desc"
:
"增加埋点记录"
,
"decorators"
:
[
"decorators"
:
[
{
{
...
@@ -697,7 +697,7 @@
...
@@ -697,7 +697,7 @@
}
}
]
]
},
},
"
g
etStats"
:
{
"
testG
etStats"
:
{
"desc"
:
"统计数据"
,
"desc"
:
"统计数据"
,
"decorators"
:
[
"decorators"
:
[
{
{
...
@@ -736,7 +736,7 @@
...
@@ -736,7 +736,7 @@
}
}
},
},
"test2"
:
{
"test2"
:
{
"addStat"
:
{
"
test2
addStat"
:
{
"desc"
:
"增加埋点记录"
,
"desc"
:
"增加埋点记录"
,
"decorators"
:
[
"decorators"
:
[
{
{
...
@@ -761,7 +761,7 @@
...
@@ -761,7 +761,7 @@
}
}
]
]
},
},
"getStats"
:
{
"
test2
getStats"
:
{
"desc"
:
"统计数据"
,
"desc"
:
"统计数据"
,
"decorators"
:
[
"decorators"
:
[
{
{
...
...
v2.0/compileServer/templates/controller.export.njk
View file @
4277e2f2
...
@@ -9,7 +9,7 @@ export default {
...
@@ -9,7 +9,7 @@ export default {
{%- for type, type_item in controllers -%}
{%- for type, type_item in controllers -%}
{%- for controller, controller_item in type_item -%}
{%- for controller, controller_item in type_item -%}
{%- for function, fucntion_item in controller_item %}
{%- for function, fucntion_item in controller_item %}
{{
type}}{{controller | capitalize}}{{function | capitalize
}}: {{type | capitalize}}{{controller | capitalize}}ControllerInstance.{{function}}
{{
function
}}: {{type | capitalize}}{{controller | capitalize}}ControllerInstance.{{function}}
{%-if loop.last-%}{%else%},{%-endif-%}
{%-if loop.last-%}{%else%},{%-endif-%}
{%- endfor -%}
{%- endfor -%}
{%-if loop.last-%}{%else%},{%-endif-%}
{%-if loop.last-%}{%else%},{%-endif-%}
...
...
v2.0/src/controller/custom/test1.controller.ts
View file @
4277e2f2
...
@@ -13,7 +13,7 @@ export default class Test1Controller {
...
@@ -13,7 +13,7 @@ export default class Test1Controller {
@
checkParams
([
'activityId'
,
'type'
])
@
checkParams
([
'activityId'
,
'type'
])
@
test1
([
'tt'
])
@
test1
([
'tt'
])
@
services
([
CommonStatService
,
CustomTestService
])
@
services
([
CommonStatService
,
CustomTestService
])
async
a
ddStat
(
async
testA
ddStat
(
context
:
IContext
<
IParams
>
,
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonStatService
,
customTestService
]:
[
CommonStatService
,
CustomTestService
]
[
commonStatService
,
customTestService
]:
[
CommonStatService
,
CustomTestService
]
...
@@ -30,7 +30,7 @@ export default class Test1Controller {
...
@@ -30,7 +30,7 @@ export default class Test1Controller {
*/
*/
@
checkParams
([
'activityId'
,
'startDay'
,
'endDay'
])
@
checkParams
([
'activityId'
,
'startDay'
,
'endDay'
])
@
services
([
CommonStatService
])
@
services
([
CommonStatService
])
async
g
etStats
(
async
testG
etStats
(
context
:
IContext
<
IParams
>
,
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonStatService
]:
[
CommonStatService
]
[
commonStatService
]:
[
CommonStatService
]
...
...
v2.0/src/controller/custom/test2.controller.ts
View file @
4277e2f2
...
@@ -10,7 +10,7 @@ export default class Test2Controller {
...
@@ -10,7 +10,7 @@ export default class Test2Controller {
*/
*/
@
checkParams
([
'activityId'
,
'type'
])
@
checkParams
([
'activityId'
,
'type'
])
@
services
([
CommonStatService
])
@
services
([
CommonStatService
])
async
addStat
(
async
test2
addStat
(
context
:
IContext
<
IParams
>
,
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonStatService
]:
[
CommonStatService
]
[
commonStatService
]:
[
CommonStatService
]
...
@@ -25,7 +25,7 @@ export default class Test2Controller {
...
@@ -25,7 +25,7 @@ export default class Test2Controller {
*/
*/
@
checkParams
([
'activityId'
,
'startDay'
,
'endDay'
])
@
checkParams
([
'activityId'
,
'startDay'
,
'endDay'
])
@
services
([
CommonStatService
])
@
services
([
CommonStatService
])
async
getStats
(
async
test2
getStats
(
context
:
IContext
<
IParams
>
,
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonStatService
]:
[
CommonStatService
]
[
commonStatService
]:
[
CommonStatService
]
...
...
v2.0/src/index.ts
View file @
4277e2f2
/** @format */
import
CommonUserController
from
'./controller/common/user.controller'
import
CommonUserController
from
'./controller/common/user.controller'
const
CommonUserControllerInstance
=
new
CommonUserController
()
const
CommonUserControllerInstance
=
new
CommonUserController
()
...
@@ -19,24 +20,24 @@ import CustomTest2Controller from './controller/custom/test2.controller'
...
@@ -19,24 +20,24 @@ import CustomTest2Controller from './controller/custom/test2.controller'
const
CustomTest2ControllerInstance
=
new
CustomTest2Controller
()
const
CustomTest2ControllerInstance
=
new
CustomTest2Controller
()
export
default
{
export
default
{
commonUserGetvipi
nfo
:
CommonUserControllerInstance
.
getVipInfo
,
getVipI
nfo
:
CommonUserControllerInstance
.
getVipInfo
,
commonUserGetrankl
ist
:
CommonUserControllerInstance
.
getRankList
,
getRankL
ist
:
CommonUserControllerInstance
.
getRankList
,
commonTaskGettaskl
ist
:
CommonTaskControllerInstance
.
getTaskList
,
getTaskL
ist
:
CommonTaskControllerInstance
.
getTaskList
,
commonTaskDocompletet
ask
:
CommonTaskControllerInstance
.
doCompleteTask
,
doCompleteT
ask
:
CommonTaskControllerInstance
.
doCompleteTask
,
commonTaskReceivetaskr
ewards
:
CommonTaskControllerInstance
.
receiveTaskRewards
,
receiveTaskR
ewards
:
CommonTaskControllerInstance
.
receiveTaskRewards
,
commonTaskGetcollectgoodsl
ist
:
CommonTaskControllerInstance
.
getCollectGoodsList
,
getCollectGoodsL
ist
:
CommonTaskControllerInstance
.
getCollectGoodsList
,
commonLoginL
ogin
:
CommonLoginControllerInstance
.
login
,
l
ogin
:
CommonLoginControllerInstance
.
login
,
commonBaseGetactivitybaseinfobyi
d
:
CommonBaseControllerInstance
.
getActivityBaseInfoById
,
getActivityBaseInfoByI
d
:
CommonBaseControllerInstance
.
getActivityBaseInfoById
,
commonStatAdds
tat
:
CommonStatControllerInstance
.
addStat
,
addS
tat
:
CommonStatControllerInstance
.
addStat
,
commonStatGets
tats
:
CommonStatControllerInstance
.
getStats
,
getS
tats
:
CommonStatControllerInstance
.
getStats
,
commonAwardsGetmyprizel
ist
:
CommonAwardsControllerInstance
.
getMyPrizeList
,
getMyPrizeL
ist
:
CommonAwardsControllerInstance
.
getMyPrizeList
,
commonAwardsReceiveobjectp
rize
:
CommonAwardsControllerInstance
.
receiveObjectPrize
,
receiveObjectP
rize
:
CommonAwardsControllerInstance
.
receiveObjectPrize
,
commonAwardsReceiveenamep
rize
:
CommonAwardsControllerInstance
.
receiveEnamePrize
,
receiveEnameP
rize
:
CommonAwardsControllerInstance
.
receiveEnamePrize
,
commonAwardsDrawlotteryp
rize
:
CommonAwardsControllerInstance
.
drawLotteryPrize
,
drawLotteryP
rize
:
CommonAwardsControllerInstance
.
drawLotteryPrize
,
commonShareGetsharei
nfo
:
CommonShareControllerInstance
.
getShareInfo
,
getShareI
nfo
:
CommonShareControllerInstance
.
getShareInfo
,
commonShareDoh
elp
:
CommonShareControllerInstance
.
doHelp
,
doH
elp
:
CommonShareControllerInstance
.
doHelp
,
customTest1Addstat
:
CustomTest1ControllerInstance
.
a
ddStat
,
testAddStat
:
CustomTest1ControllerInstance
.
testA
ddStat
,
customTest1Getstats
:
CustomTest1ControllerInstance
.
g
etStats
,
testGetStats
:
CustomTest1ControllerInstance
.
testG
etStats
,
customTest2Addstat
:
CustomTest2ControllerInstance
.
addStat
,
test2addStat
:
CustomTest2ControllerInstance
.
test2
addStat
,
customTest2Getstats
:
CustomTest2ControllerInstance
.
getStats
test2getStats
:
CustomTest2ControllerInstance
.
test2
getStats
}
}
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