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
b3b53ede
Commit
b3b53ede
authored
Nov 26, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
集卡代码
parent
71207cb3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
55 additions
and
12 deletions
+55
-12
package.json
v2.0/package.json
+1
-1
card.controller.ts
v2.0/src/controller/card.controller.ts
+15
-7
customUser.ts
v2.0/src/customUser.ts
+4
-1
card.service.ts
v2.0/src/service/common/card.service.ts
+23
-0
index.ts
v2.0/src/service/common/index.ts
+5
-2
user.d.ts
v2.0/src/typings/user.d.ts
+6
-0
yarn.lock
v2.0/yarn.lock
+1
-1
No files found.
v2.0/package.json
View file @
b3b53ede
...
...
@@ -12,7 +12,7 @@
"mpath"
:
"^0.7.0"
,
"node-xlsx"
:
"^0.15.0"
,
"source-map-support"
:
"^0.5.19"
,
"taobao-mini-sdk"
:
"
^
0.2.4"
"taobao-mini-sdk"
:
"0.2.4"
},
"scripts"
:
{
"start"
:
"tsc"
,
...
...
v2.0/src/controller/card.controller.ts
View file @
b3b53ede
...
...
@@ -2,7 +2,7 @@
import
{
services
,
checkParams
,
preCheck
,
preUpdate
}
from
'../decorator/common'
import
{
resultsModel
}
from
'../sdk'
import
{
Common
UserService
,
CommonGame
Service
}
from
'../service/common'
import
{
Common
Card
Service
}
from
'../service/common'
import
{
checkActivityTime
,
checkJoinId
,
...
...
@@ -19,15 +19,23 @@ export interface ISumitGameControllerInfos extends IControllerInfos {
export
default
class
Card
{
@
checkParams
([
'activityId'
])
@
services
([
Common
Game
Service
])
@
services
([
Common
Card
Service
])
async
getCollectCardInfo
(
context
:
IContext
<
IParams
>
,
{
userInfo
,
activityInfo
}:
IControllerInfos
,
[
gameService
]:
[
CommonGame
Service
]
[
cardService
]:
[
CommonCard
Service
]
)
{
// const joinResult = await gameService.addJoinRecord(userInfo)
// return resultsModel.success({
// ...joinResult
// })
const
{
joinedTimes
,
gameTimes
}
=
userInfo
}
@
checkParams
([
'activityId'
])
@
services
([
CommonCardService
])
@
preCheck
([
checkActivityTime
,
checkVip
])
async
doJoin
(
context
:
IContext
<
IParams
>
,
{
userInfo
,
activityInfo
}:
IControllerInfos
,
[
cardService
]:
[
CommonCardService
]
)
{
const
{
joinedTimes
,
gameTimes
}
=
userInfo
}
}
v2.0/src/customUser.ts
View file @
b3b53ede
...
...
@@ -3,5 +3,8 @@
export
const
customInitUserInfo
:
ICustomUserInfo
=
{
gameTimes
:
0
,
maxScore
:
0
,
totalScore
:
0
totalScore
:
0
,
joinedTimes
:
0
,
cardsCollectedCount
:
0
,
cardInfo
:
{}
}
v2.0/src/service/common/card.service.ts
0 → 100644
View file @
b3b53ede
/**
* 基本信息
*
* @format
*/
import
{
BaseDao
,
TBAPIS
}
from
'../../sdk'
import
{
JOIN_DB_NAME
}
from
'../../db'
import
{
ACTIVITY_STATUS
}
from
'../../constants'
import
{
getToday
}
from
'../../utils'
import
UserService
from
'./user.service'
export
default
class
CardService
extends
UserService
{
context
:
IContext
<
IParams
>
joindao
:
IBaseDao
constructor
(
context
:
IContext
<
IParams
>
)
{
super
(
context
)
this
.
joindao
=
new
BaseDao
(
context
,
JOIN_DB_NAME
)
}
// 集卡
async
collectCard
(
activityId
:
string
)
{}
}
v2.0/src/service/common/index.ts
View file @
b3b53ede
...
...
@@ -7,6 +7,7 @@ import CommonAwardsService from './awards.service'
import
CommonTaskService
from
'./task.service'
import
CommonStatService
from
'./stat.service'
import
CommonGameService
from
'./game.service'
import
CommonCardService
from
'./card.service'
const
common
=
{
CommonAccessService
,
...
...
@@ -15,7 +16,8 @@ const common = {
CommonAwardsService
,
CommonTaskService
,
CommonStatService
,
CommonGameService
CommonGameService
,
CommonCardService
}
export
default
common
...
...
@@ -27,5 +29,6 @@ export {
CommonAwardsService
,
CommonTaskService
,
CommonStatService
,
CommonGameService
CommonGameService
,
CommonCardService
}
v2.0/src/typings/user.d.ts
View file @
b3b53ede
...
...
@@ -7,6 +7,12 @@ interface ICustomUserInfo {
maxScore
?:
number
totalScore
?:
number
updateScoreTime
?:
number
// 集卡
joinedTimes
?:
number
cardsCollectedCount
?:
number
cardInfo
:
{
[
key
:
string
]:
number
}
}
interface
ICommonUserInfo
{
...
...
v2.0/yarn.lock
View file @
b3b53ede
...
...
@@ -907,7 +907,7 @@ table@^5.2.3:
slice-ansi "^2.1.0"
string-width "^3.0.0"
taobao-mini-sdk@
^
0.2.4:
taobao-mini-sdk@0.2.4:
version "0.2.4"
resolved "https://registry.npm.taobao.org/taobao-mini-sdk/download/taobao-mini-sdk-0.2.4.tgz#5074718bd4135263adbabbf30d8c6b44a0da1d9a"
integrity sha1-UHRxi9QTUmOturvzDYxrRKDaHZo=
...
...
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