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
b31d858e
Commit
b31d858e
authored
Oct 30, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
perf
parent
46d532cb
Changes
15
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
10915 additions
and
47 deletions
+10915
-47
awards.controller.d.ts
v2.0/dist/controller/awards.controller.d.ts
+1
-1
share.controller.js
v2.0/dist/controller/share.controller.js
+3
-2
share.controller.js.map
v2.0/dist/controller/share.controller.js.map
+1
-1
stat.controller.d.ts
v2.0/dist/controller/stat.controller.d.ts
+1
-1
index.d.ts
v2.0/dist/index.d.ts
+2
-2
result.txt
v2.0/result.txt
+10737
-0
share.controller.ts
v2.0/src/controller/share.controller.ts
+3
-2
preCheck.ts
v2.0/src/decorator/preCheck.ts
+20
-0
result.txt
v2.0/src/result.txt
+72
-0
activityConfig.d.ts
v2.0/src/typings/activityConfig.d.ts
+0
-37
prizeConfig.d.ts
v2.0/src/typings/prizeConfig.d.ts
+26
-0
checkActivityTime.ts
v2.0/src/utils/check/checkActivityTime.ts
+3
-0
checkTaskLimit.ts
v2.0/src/utils/check/checkTaskLimit.ts
+13
-0
task.ts
v2.0/src/utils/package/task.ts
+32
-0
tsconfig.json
v2.0/tsconfig.json
+1
-1
No files found.
v2.0/dist/controller/awards.controller.d.ts
View file @
b31d858e
...
...
@@ -33,7 +33,7 @@ export default class AwardsController {
/**
* 权益重新领取
*/
receiveEnamePrize
(
context
:
IContext
<
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
AwardsService
]):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
number
[]
|
object
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
CodeType
|
IAwards
,
true
>>
;
receiveEnamePrize
(
context
:
IContext
<
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
AwardsService
]):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
CodeType
|
IAwards
,
true
>>
;
/**
* 概率抽奖
*/
...
...
v2.0/dist/controller/share.controller.js
View file @
b31d858e
...
...
@@ -54,6 +54,8 @@ var utils_1 = require("../utils");
var
service_1
=
require
(
"../service"
);
var
registeInfos_1
=
require
(
"../decorator/registeInfos"
);
var
constants_2
=
require
(
"../constants"
);
var
checkActivityTime_1
=
require
(
"../utils/check/checkActivityTime"
);
var
preCheck_1
=
require
(
"../decorator/preCheck"
);
var
Share
=
/** @class */
(
function
()
{
function
Share
()
{
}
...
...
@@ -160,9 +162,8 @@ var Share = /** @class */ (function () {
],
Share
.
prototype
,
"getShareInfo"
,
null
);
__decorate
([
check_1
.
paramsCheck
([
'activityId'
,
'inviteId'
]),
check_1
.
activityTimeCheck
,
check_1
.
userCheck
({
intercept
:
true
}),
registeInfos_1
.
registeInfos
([
'userInfo'
,
'vipInfo'
,
'activityInfo'
]),
preCheck_1
.
preCheck
([
checkActivityTime_1
.
checkActivityTime
]),
services_1
.
services
([
service_1
.
UserService
,
service_1
.
TaskService
,
service_1
.
StatService
,
service_1
.
AccessService
]),
__metadata
(
"design:type"
,
Function
),
__metadata
(
"design:paramtypes"
,
[
Object
,
Object
,
Array
]),
...
...
v2.0/dist/controller/share.controller.js.map
View file @
b31d858e
{"version":3,"file":"share.controller.js","sourceRoot":"","sources":["../../src/controller/share.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2C;AAC3C,4CAA8E;AAC9E,kDAAgD;AAEhD,8BAAqC;AACrC,kCAAmE;AACnE,sCAAiF;AACjF,0DAAwD;AACxD,0CAAwC;AAExC;IAAA;IAqGA,CAAC;IApGC;;OAEG;IAKG,4BAAY,GAAlB,UACE,OAEE,EACF,EAA8B;YAA5B,QAAQ,cAAA;;;;gBAOO,OAAO,GACpB,QAAQ,oBADY,CACZ;gBAEZ,sBAAO,kBAAY,CAAC,OAAO,CAAC;wBAC1B,OAAO,EAAE,OAAO;qBACjB,CAAC,EAAA;;;KACH;IACD;;OAEG;IAMG,sBAAM,GAAZ,UACE,OAGE,EACF,EAAqD,EACrD,EAA+F;YAD7F,QAAQ,cAAA,EAAE,OAAO,aAAA,EAAE,YAAY,kBAAA;YAChC,WAAW,QAAA,EAAE,WAAW,QAAA,EAAE,WAAW,QAAA;;;;;;;wBAEhC,KAA2B,OAAO,CAAC,IAAI,EAArC,QAAQ,cAAA,EAAE,UAAU,gBAAA,CAAiB;wBACrC,MAAM,GAAK,OAAO,OAAZ,CAAY;wBAE1B,IAAI,MAAM,KAAK,QAAQ;4BAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,oBAAoB,CAAC,EAAA;wBAEjD,qBAAM,WAAW,CAAC,mBAAmB,CAAC,QAAQ,CAAC;4BAEjF,iCAAiC;0BAFgD;;wBAA3E,cAAc,GAAc,SAA+C;wBAEjF,iCAAiC;wBACjC,IAAI,CAAC,cAAc;4BAAE,sBAAO,kBAAY,CAAC,KAAK,CAAC,sBAAU,CAAC,uBAAuB,CAAC;gCAElF,aAAa;8BAFqE;wBAGnD,qBAAM,WAAW,CAAC,mBAAmB,CAA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AA;;wBARF,mBAAmB;wBACnB,SAOE,CAAA;wBAEF,qBAAM,WAAW,CAAC,OAAO,CAAC,qBAAS,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAA;;wBAA5D,SAA4D,CAAA;wBAE5D,sBAAO,kBAAY,CAAC,OAAO,CAAC,IAAI,CAAC,EAAA;;;;KAClC;IA5FD;QAJC,mBAAW,CAAC,CAAC,YAAY,CAAC,CAAC;QAC3B,iBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,2BAAY,CAAC,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC;QAC1C,mBAAQ,CAAC,CAAC,qBAAW,CAAC,CAAC;;;;6CAkBvB;IASD;QALC,mBAAW,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvC,yBAAiB;QACjB,iBAAS,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC9B,2BAAY,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;QACrD,mBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,EAAE,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;uCAmEhE;IACH,YAAC;CAAA,AArGD,IAqGC;kBArGoB,KAAK"}
\ No newline at end of file
{"version":3,"file":"share.controller.js","sourceRoot":"","sources":["../../src/controller/share.controller.ts"],"names":[],"mappings":";AAAA,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEd,4CAA2C;AAC3C,4CAA8E;AAC9E,kDAAgD;AAEhD,8BAAqC;AACrC,kCAAmE;AACnE,sCAAiF;AACjF,0DAAwD;AACxD,0CAAwC;AACxC,sEAAoE;AACpE,kDAAgD;AAEhD;IAAA;IAoGA,CAAC;IAnGC;;OAEG;IAKG,4BAAY,GAAlB,UACE,OAEE,EACF,EAA8B;YAA5B,QAAQ,cAAA;;;;gBAOO,OAAO,GACpB,QAAQ,oBADY,CACZ;gBAEZ,s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,CAAC,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC;QACvC,2BAAY,CAAC,CAAC,UAAU,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;QACrD,mBAAQ,CAAC,CAAC,qCAAiB,CAAC,CAAC;QAC7B,mBAAQ,CAAC,CAAC,qBAAW,EAAE,qBAAW,EAAE,qBAAW,EAAE,uBAAa,CAAC,CAAC;;;;uCAmEhE;IACH,YAAC;CAAA,AApGD,IAoGC;kBApGoB,KAAK"}
\ No newline at end of file
v2.0/dist/controller/stat.controller.d.ts
View file @
b31d858e
...
...
@@ -18,5 +18,5 @@ export default class StatController {
/**
* 统计数据
*/
getStats
(
context
:
IContext
<
IGetStatsParams
>
):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
number
[]
|
object
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
,
true
>>
;
getStats
(
context
:
IContext
<
IGetStatsParams
>
):
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
,
true
>>
;
}
v2.0/dist/index.d.ts
View file @
b31d858e
...
...
@@ -17,12 +17,12 @@ declare const _default: {
list
:
IAwards
[];
}
>>
;
receiveObjectPrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveOjectParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
IResult
<
boolean
>>
;
receiveEnamePrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
IAwards
|
import
(
"taobao-mini-sdk/lib/utils/codetypes"
).
CodeType
,
true
>>
;
receiveEnamePrize
:
(
context
:
IContext
<
import
(
"./controller/awards.controller"
).
IReceiveEnameParams
>
,
{}:
{},
[
awardSer
]:
[
import
(
"./service"
).
AwardsService
])
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
import
(
"taobao-mini-sdk/lib/utils/codetypes"
).
CodeType
|
IAwards
,
true
>>
;
doHelp
:
(
context
:
IContext
<
{
activityId
:
string
;
inviteId
:
string
;
}
>
,
{
userInfo
,
vipInfo
,
activityInfo
}:
IControllerInfos
,
[
userService
,
taskService
,
statService
]:
[
import
(
"./service/user.service"
).
default
,
import
(
"./service"
).
TaskService
,
import
(
"./service"
).
StatService
,
import
(
"./service"
).
AccessService
])
=>
Promise
<
IResult
<
boolean
>>
;
getStats
:
(
context
:
IContext
<
import
(
"./controller/stat.controller"
).
IGetStatsParams
>
)
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
string
[]
|
object
[]
|
number
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
,
true
>>
;
getStats
:
(
context
:
IContext
<
import
(
"./controller/stat.controller"
).
IGetStatsParams
>
)
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
string
|
boolean
|
object
|
object
[]
|
number
[]
|
string
[],
false
>
|
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
any
,
true
>>
;
addStat
:
(
context
:
IContext
<
import
(
"./controller/stat.controller"
).
IAddStatsParams
>
,
{
userInfo
}:
IControllerInfos
,
[
statService
]:
[
import
(
"./service"
).
StatService
])
=>
Promise
<
import
(
"taobao-mini-sdk/lib/utils/resultmodel"
).
Result
<
boolean
,
true
>>
;
getRankList
:
(
context
:
IContext
<
{
activityId
:
string
;
...
...
v2.0/result.txt
0 → 100644
View file @
b31d858e
This diff is collapsed.
Click to expand it.
v2.0/src/controller/share.controller.ts
View file @
b31d858e
...
...
@@ -9,6 +9,8 @@ import { getToday, setNewVipUserData, checkNewVip } from '../utils'
import
{
UserService
,
AccessService
,
TaskService
,
StatService
}
from
'../service'
import
{
registeInfos
}
from
'../decorator/registeInfos'
import
{
STAT_TYPE
}
from
'../constants'
import
{
checkActivityTime
}
from
'../utils/check/checkActivityTime'
import
{
preCheck
}
from
'../decorator/preCheck'
export
default
class
Share
{
/**
...
...
@@ -40,9 +42,8 @@ export default class Share {
* 完成分享
*/
@
paramsCheck
([
'activityId'
,
'inviteId'
])
@
activityTimeCheck
@
userCheck
({
intercept
:
true
})
@
registeInfos
([
'userInfo'
,
'vipInfo'
,
'activityInfo'
])
@
preCheck
([
checkActivityTime
])
@
services
([
UserService
,
TaskService
,
StatService
,
AccessService
])
async
doHelp
(
context
:
IContext
<
{
...
...
v2.0/src/decorator/preCheck.ts
0 → 100644
View file @
b31d858e
/** @format */
// 检验参数是否存在
export
const
preCheck
=
(
checks
:
any
[])
=>
{
return
function
(
target
:
Object
,
name
:
string
,
descriptor
:
PropertyDescriptor
)
{
const
method
=
descriptor
.
value
descriptor
.
value
=
async
function
(...
args
:
any
[])
{
let
[
context
,
otherArgs
=
{}]
=
args
const
dataKeys
=
Object
.
keys
(
context
.
data
)
for
(
let
i
=
0
;
i
<
checks
.
length
;
i
++
)
{
const
checkFn
=
checks
[
i
]
const
result
=
await
checkFn
.
apply
(
target
,
[
context
,
{
...
otherArgs
}])
otherArgs
=
{
...
otherArgs
,
...
result
}
}
return
method
.
apply
(
target
,
[
context
,
{
...
otherArgs
}])
}
}
}
v2.0/src/result.txt
0 → 100644
View file @
b31d858e
src
├─constants.ts
├─db.ts
├─errorCode.ts
├─index.ts
├─sdk.ts
├─vipMock.ts
├─utils
| ├─index.ts
| ├─package
| | ├─exportHandlers.ts
| | ├─format.ts
| | ├─getSession.ts
| | ├─getToday.ts
| | ├─getUserOrderlist.ts
| | ├─helper.ts
| | ├─lockUpdate.ts
| | ├─logger.ts
| | ├─rand.ts
| | ├─sendTBAward.ts
| | ├─task.ts
| | ├─userUpdate.ts
| | └vip.ts
| ├─custom
| ├─common
| ├─check
| | ├─checkActivityTime.ts
| | └checkTaskLimit.ts
├─typings
| ├─activityConfig.d.ts
| ├─awards.d.ts
| ├─dao.d.ts
| ├─index.d.ts
| ├─item.d.ts
| ├─prizeConfig.d.ts
| ├─resultModel.d.ts
| ├─seller.d.ts
| └user.d.ts
├─test
├─service
| ├─access.service.ts
| ├─awards.service.ts
| ├─base.service.ts
| ├─index.ts
| ├─stat.service.ts
| ├─task.service.ts
| ├─user.service.ts
| ├─custom
| ├─common
├─decorator
| ├─check.ts
| ├─index.ts
| ├─noCatch.ts
| ├─preCheck.ts
| ├─registeInfos.ts
| ├─services.ts
| ├─custom
| ├─common
├─controller
| ├─awards.controller.ts
| ├─base.controller.ts
| ├─share.controller.ts
| ├─stat.controller.ts
| ├─task.controller.ts
| ├─user.controller.ts
| ├─custom
| ├─common
├─config
| ├─index.ts
| ├─online.ts
| └test.ts
├─check
\ No newline at end of file
v2.0/src/typings/activity.d.ts
→
v2.0/src/typings/activity
Config
.d.ts
View file @
b31d858e
...
...
@@ -27,18 +27,6 @@ type ITaskType =
|
'invites'
type
ITasks
=
{
[
key
in
ITaskType
]:
ITaskConfig
}
// interface ITasks {
// // follow?: ITaskConfig
// // member?: ITaskConfig
// // sign?: ITaskConfig
// // exchangeCredits?: ITaskConfig
// // browseGoods?: ITaskConfig
// // orderGoods?: ITaskConfig
// // collectGoods?: ITaskConfig
// // jumpLink?: ITaskConfig
// // invites?: ITaskConfig
// [key in ITaskType]: ITaskConfig
// }
interface
ITaskConfig
{
title
?:
string
// 任务标题
...
...
@@ -49,28 +37,3 @@ interface ITaskConfig {
itemIds
?:
string
// 任务商品
checked
?:
boolean
// 是否选中(B端需勾选时)
}
interface
IActivityPrize
{
_id
?:
string
id
?:
string
activityId
?:
string
ename
?:
string
prizeDataType
:
number
type
:
number
image
?:
string
name
:
string
probability
?:
string
|
number
properiodto
?:
number
properiodfrom
?:
number
lockStatus
?:
number
switchStock
?:
number
rank
?:
string
|
number
credits
?:
string
|
number
useUrl
?:
string
stock
?:
number
useStock
?:
number
openId
?:
string
deleteStatus
?:
number
createTime
?:
number
updateTime
?:
number
}
v2.0/src/typings/prizeConfig.d.ts
0 → 100644
View file @
b31d858e
/** @format */
interface
IActivityPrize
{
_id
?:
string
id
?:
string
activityId
?:
string
ename
?:
string
prizeDataType
:
number
type
:
number
image
?:
string
name
:
string
probability
?:
string
|
number
properiodto
?:
number
properiodfrom
?:
number
lockStatus
?:
number
switchStock
?:
number
rank
?:
string
|
number
credits
?:
string
|
number
useUrl
?:
string
stock
?:
number
useStock
?:
number
openId
?:
string
deleteStatus
?:
number
createTime
?:
number
updateTime
?:
number
}
v2.0/src/utils/check/checkActivityTime.ts
0 → 100644
View file @
b31d858e
/** @format */
export
const
checkActivityTime
=
async
()
=>
{}
v2.0/src/utils/check/checkTaskLimit.ts
0 → 100644
View file @
b31d858e
/** @format */
export
const
checkTaskLimit
=
(
taskType
:
ITaskType
)
=>
{
return
async
function
(
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
)
{
const
{
tasks
:
{
[
taskType
]:
{
value
,
taskRateType
,
times
}
}
}
=
activityInfo
const
{}
=
userInfo
}
}
v2.0/src/utils/package/task.ts
0 → 100644
View file @
b31d858e
/**
* 根据任务类型获取任务完成情况
*
* @param {IUserInfo} userInfo
* @param {string} taskType
* @returns {array}
* @memberof TaskService
*/
export
getCompleteTaskByUserTaskInfo
(
taskType
:
string
,
userInfo
:
IUserInfo
):
{
completeTimes
:
number
taskInfo
:
ITaskDetail
[]
}
{
const
{
taskInfo
=
{}
}
=
userInfo
let
targetTaskList
=
[]
Object
.
keys
(
taskInfo
).
forEach
(
day
=>
{
if
(
taskInfo
[
day
]?.[
taskType
])
{
const
dayTaskInfo
=
Array
.
isArray
(
taskInfo
[
day
]?.[
taskType
])
?
taskInfo
[
day
]?.[
taskType
]
:
[
taskInfo
[
day
]?.[
taskType
]]
targetTaskList
=
[...
targetTaskList
,
...
dayTaskInfo
]
}
})
return
{
completeTimes
:
targetTaskList
?.
length
||
0
,
taskInfo
:
targetTaskList
}
}
\ No newline at end of file
v2.0/tsconfig.json
View file @
b31d858e
...
...
@@ -5,7 +5,7 @@
"lib"
:
[
"es6"
,
"dom"
,
"es7"
],
"typeRoots"
:
[
"./node_modules/@types/"
,
"./src/typings/"
],
"typeRoots"
:
[
"./node_modules/@types/"
,
"./src/typings/"
,
"./src/typings/common/"
],
"outDir"
:
"./dist"
,
"sourceMap"
:
true
,
"module"
:
"commonjs"
,
...
...
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