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 @@
},
"custom"
:
{
"test1"
:
{
"
a
ddStat"
:
{
"
testA
ddStat"
:
{
"desc"
:
"增加埋点记录"
,
"decorators"
:
[
{
...
...
@@ -697,7 +697,7 @@
}
]
},
"
g
etStats"
:
{
"
testG
etStats"
:
{
"desc"
:
"统计数据"
,
"decorators"
:
[
{
...
...
@@ -736,7 +736,7 @@
}
},
"test2"
:
{
"addStat"
:
{
"
test2
addStat"
:
{
"desc"
:
"增加埋点记录"
,
"decorators"
:
[
{
...
...
@@ -761,7 +761,7 @@
}
]
},
"getStats"
:
{
"
test2
getStats"
:
{
"desc"
:
"统计数据"
,
"decorators"
:
[
{
...
...
v2.0/compileServer/templates/controller.export.njk
View file @
4277e2f2
...
...
@@ -9,7 +9,7 @@ export default {
{%- for type, type_item in controllers -%}
{%- for controller, controller_item in type_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-%}
{%- endfor -%}
{%-if loop.last-%}{%else%},{%-endif-%}
...
...
v2.0/src/controller/custom/test1.controller.ts
View file @
4277e2f2
...
...
@@ -13,7 +13,7 @@ export default class Test1Controller {
@
checkParams
([
'activityId'
,
'type'
])
@
test1
([
'tt'
])
@
services
([
CommonStatService
,
CustomTestService
])
async
a
ddStat
(
async
testA
ddStat
(
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonStatService
,
customTestService
]:
[
CommonStatService
,
CustomTestService
]
...
...
@@ -30,7 +30,7 @@ export default class Test1Controller {
*/
@
checkParams
([
'activityId'
,
'startDay'
,
'endDay'
])
@
services
([
CommonStatService
])
async
g
etStats
(
async
testG
etStats
(
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonStatService
]:
[
CommonStatService
]
...
...
v2.0/src/controller/custom/test2.controller.ts
View file @
4277e2f2
...
...
@@ -10,7 +10,7 @@ export default class Test2Controller {
*/
@
checkParams
([
'activityId'
,
'type'
])
@
services
([
CommonStatService
])
async
addStat
(
async
test2
addStat
(
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonStatService
]:
[
CommonStatService
]
...
...
@@ -25,7 +25,7 @@ export default class Test2Controller {
*/
@
checkParams
([
'activityId'
,
'startDay'
,
'endDay'
])
@
services
([
CommonStatService
])
async
getStats
(
async
test2
getStats
(
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonStatService
]:
[
CommonStatService
]
...
...
v2.0/src/index.ts
View file @
4277e2f2
/** @format */
import
CommonUserController
from
'./controller/common/user.controller'
const
CommonUserControllerInstance
=
new
CommonUserController
()
...
...
@@ -19,24 +20,24 @@ import CustomTest2Controller from './controller/custom/test2.controller'
const
CustomTest2ControllerInstance
=
new
CustomTest2Controller
()
export
default
{
commonUserGetvipi
nfo
:
CommonUserControllerInstance
.
getVipInfo
,
commonUserGetrankl
ist
:
CommonUserControllerInstance
.
getRankList
,
commonTaskGettaskl
ist
:
CommonTaskControllerInstance
.
getTaskList
,
commonTaskDocompletet
ask
:
CommonTaskControllerInstance
.
doCompleteTask
,
commonTaskReceivetaskr
ewards
:
CommonTaskControllerInstance
.
receiveTaskRewards
,
commonTaskGetcollectgoodsl
ist
:
CommonTaskControllerInstance
.
getCollectGoodsList
,
commonLoginL
ogin
:
CommonLoginControllerInstance
.
login
,
commonBaseGetactivitybaseinfobyi
d
:
CommonBaseControllerInstance
.
getActivityBaseInfoById
,
commonStatAdds
tat
:
CommonStatControllerInstance
.
addStat
,
commonStatGets
tats
:
CommonStatControllerInstance
.
getStats
,
commonAwardsGetmyprizel
ist
:
CommonAwardsControllerInstance
.
getMyPrizeList
,
commonAwardsReceiveobjectp
rize
:
CommonAwardsControllerInstance
.
receiveObjectPrize
,
commonAwardsReceiveenamep
rize
:
CommonAwardsControllerInstance
.
receiveEnamePrize
,
commonAwardsDrawlotteryp
rize
:
CommonAwardsControllerInstance
.
drawLotteryPrize
,
commonShareGetsharei
nfo
:
CommonShareControllerInstance
.
getShareInfo
,
commonShareDoh
elp
:
CommonShareControllerInstance
.
doHelp
,
customTest1Addstat
:
CustomTest1ControllerInstance
.
a
ddStat
,
customTest1Getstats
:
CustomTest1ControllerInstance
.
g
etStats
,
customTest2Addstat
:
CustomTest2ControllerInstance
.
addStat
,
customTest2Getstats
:
CustomTest2ControllerInstance
.
getStats
getVipI
nfo
:
CommonUserControllerInstance
.
getVipInfo
,
getRankL
ist
:
CommonUserControllerInstance
.
getRankList
,
getTaskL
ist
:
CommonTaskControllerInstance
.
getTaskList
,
doCompleteT
ask
:
CommonTaskControllerInstance
.
doCompleteTask
,
receiveTaskR
ewards
:
CommonTaskControllerInstance
.
receiveTaskRewards
,
getCollectGoodsL
ist
:
CommonTaskControllerInstance
.
getCollectGoodsList
,
l
ogin
:
CommonLoginControllerInstance
.
login
,
getActivityBaseInfoByI
d
:
CommonBaseControllerInstance
.
getActivityBaseInfoById
,
addS
tat
:
CommonStatControllerInstance
.
addStat
,
getS
tats
:
CommonStatControllerInstance
.
getStats
,
getMyPrizeL
ist
:
CommonAwardsControllerInstance
.
getMyPrizeList
,
receiveObjectP
rize
:
CommonAwardsControllerInstance
.
receiveObjectPrize
,
receiveEnameP
rize
:
CommonAwardsControllerInstance
.
receiveEnamePrize
,
drawLotteryP
rize
:
CommonAwardsControllerInstance
.
drawLotteryPrize
,
getShareI
nfo
:
CommonShareControllerInstance
.
getShareInfo
,
doH
elp
:
CommonShareControllerInstance
.
doHelp
,
testAddStat
:
CustomTest1ControllerInstance
.
testA
ddStat
,
testGetStats
:
CustomTest1ControllerInstance
.
testG
etStats
,
test2addStat
:
CustomTest2ControllerInstance
.
test2
addStat
,
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