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
8c8a77ad
Commit
8c8a77ad
authored
Nov 10, 2020
by
qinhaitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:
🎸
配置信息
parent
2e6e259c
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
2544 additions
and
29 deletions
+2544
-29
config.json
v2.0/compileServer/config.json
+98
-0
package.json
v2.0/compileServer/package.json
+17
-18
yarn.lock
v2.0/compileServer/yarn.lock
+2351
-0
base.controller.ts
v2.0/src/controller/base.controller.ts
+7
-2
base.controller.ts
v2.0/src/controller/common/base.controller.ts
+29
-0
login.controller.ts
v2.0/src/controller/common/login.controller.ts
+32
-0
share.controller.ts
v2.0/src/controller/share.controller.ts
+1
-1
task.controller.ts
v2.0/src/controller/task.controller.ts
+1
-1
index.ts
v2.0/src/index.ts
+6
-0
task.service.ts
v2.0/src/service/common/task.service.ts
+2
-7
No files found.
v2.0/compileServer/config.json
View file @
8c8a77ad
...
...
@@ -269,6 +269,104 @@
]
}
},
"share"
:
{
"getShareInfo"
:
{
"desc"
:
"获取邀请信息"
,
"decorators"
:[
{
"type"
:
"common"
,
"name"
:
"checkParams"
,
"params"
:
[
"activityId"
]
}
]
}
},
"login"
:
{
"login"
:{
"desc"
:
"登录接口, 初始化/更新用户信息"
,
"decorators"
:[
{
"type"
:
"common"
,
"name"
:
"checkParams"
,
"params"
:
[
"activityId"
,
"userNick"
,
"avatar"
,
"isFollow"
]
},
{
"type"
:
"common"
,
"name"
:
"noCheckUser"
,
"params"
:
[
"activityId"
]
},
{
"type"
:
"common"
,
"name"
:
"registeInfos"
,
"params"
:
[
"vipInfo"
]
}
],
"main"
:
[
{
"type"
:
"common"
,
"service"
:
"user"
,
"function"
:
"doLogin"
,
"params"
:
[
{
"type"
:
"var"
,
"value"
:
"userInfo"
},
{
"type"
:
"var"
,
"value"
:
"vipInfo"
},
{
"type"
:
"var"
,
"value"
:
"activityInfo"
}
],
"return"
:
true
},
{
"type"
:
"common"
,
"service"
:
"access"
,
"function"
:
"addAccess"
,
"params"
:
[
{
"type"
:
"var"
,
"value"
:
"commonUserDoLoginResult1"
},
{
"type"
:
"var"
,
"value"
:
"vipInfo"
}
],
"return"
:
true
}
]
}
},
"base"
:
{
"getActivityBaseInfoById"
:{
"desc"
:
"活动基本信息"
,
"decorators"
:[
{
"type"
:
"common"
,
"name"
:
"checkParams"
,
"params"
:
[
"activityId"
]
},
{
"type"
:
"common"
,
"name"
:
"noCheckUser"
,
"params"
:
[
"activityId"
]
}
],
"main"
:
[
{
"type"
:
"common"
,
"service"
:
"base"
,
"function"
:
"getBaseInfo"
,
"params"
:
[
{
"type"
:
"var"
,
"value"
:
"context.data.activityId"
}
],
"return"
:
true
}
]
}
},
"stat"
:
{
"addStat"
:
{
"desc"
:
"增加埋点记录"
,
...
...
v2.0/compileServer/package.json
View file @
8c8a77ad
{
"name"
:
"nunjucks-test"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"author"
:
""
,
"license"
:
"ISC"
,
"devDependencies"
:
{
"gulp"
:
"^4.0.2"
,
"gulp-nunjucks-render"
:
"^2.2.3"
,
"gulp-rename"
:
"^2.0.0"
},
"dependencies"
:
{
"fs-extra"
:
"^9.0.1"
}
"name"
:
"nunjucks-test"
,
"version"
:
"1.0.0"
,
"description"
:
""
,
"main"
:
"index.js"
,
"scripts"
:
{
"test"
:
"echo
\"
Error: no test specified
\"
&& exit 1"
},
"author"
:
""
,
"license"
:
"ISC"
,
"devDependencies"
:
{
"gulp"
:
"^4.0.2"
,
"gulp-nunjucks-render"
:
"^2.2.3"
,
"gulp-rename"
:
"^2.0.0"
},
"dependencies"
:
{
"fs-extra"
:
"^9.0.1"
}
\ No newline at end of file
}
v2.0/compileServer/yarn.lock
0 → 100644
View file @
8c8a77ad
This diff is collapsed.
Click to expand it.
v2.0/src/controller/base.controller.ts
View file @
8c8a77ad
...
...
@@ -14,9 +14,14 @@ export default class BaseController {
context
:
IContext
<
{
activityId
:
string
}
>
,
{
activityInfo
}:
IControllerInfos
{}:
IControllerInfos
,
[
baseService
]:
[
CommonBaseService
]
):
Promise
<
IResult
<
IActivityInfo
>>
{
return
resultsModel
.
success
(
activityInfo
)
const
{
activityId
}
=
context
.
data
const
activityInfo
=
await
baseService
.
getBaseInfo
(
activityId
)
return
resultsModel
.
success
({
...
activityInfo
})
}
/**
...
...
v2.0/src/controller/common/base.controller.ts
0 → 100644
View file @
8c8a77ad
/** @format */
import
commonDecorator
,
{
services
}
from
'../../decorator/common'
import
commonUtilCheck
from
'../../utils/common/check'
import
commonUtilUpdate
from
'../../utils/common/update'
import
customDecorator
from
'../../decorator/custom'
import
customUtil
from
'../../utils/custom'
import
{
resultsModel
}
from
'../../sdk'
import
{
CommonBaseService
}
from
'../../service/common'
export
default
class
BaseController
{
/**
* 活动基本信息
*/
@
commonDecorator
.
checkParams
([
'activityId'
])
@
commonDecorator
.
noCheckUser
([
'activityId'
])
@
services
([
CommonBaseService
])
async
getActivityBaseInfoById
(
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
}:
IControllerInfos
,
[
commonBaseService
]:
[
CommonBaseService
]
)
{
const
commonBaseGetBaseInfoResult1
=
await
commonBaseService
.
getBaseInfo
(
context
.
data
.
activityId
)
return
resultsModel
.
success
({
...
commonBaseGetBaseInfoResult1
})
}
}
v2.0/src/controller/common/login.controller.ts
0 → 100644
View file @
8c8a77ad
/** @format */
import
commonDecorator
,
{
services
}
from
'../../decorator/common'
import
commonUtilCheck
from
'../../utils/common/check'
import
commonUtilUpdate
from
'../../utils/common/update'
import
customDecorator
from
'../../decorator/custom'
import
customUtil
from
'../../utils/custom'
import
{
resultsModel
}
from
'../../sdk'
import
{
CommonUserService
,
CommonAccessService
}
from
'../../service/common'
export
default
class
LoginController
{
/**
* 登录接口, 初始化/更新用户信息
*/
@
commonDecorator
.
checkParams
([
'activityId'
,
'userNick'
,
'avatar'
,
'isFollow'
])
@
commonDecorator
.
noCheckUser
([
'activityId'
])
@
commonDecorator
.
registeInfos
([
'vipInfo'
])
@
services
([
CommonUserService
,
CommonAccessService
])
async
login
(
context
:
IContext
<
IParams
>
,
{
activityInfo
,
userInfo
,
vipInfo
}:
IControllerInfos
,
[
commonUserService
,
commonAccessService
]:
[
CommonUserService
,
CommonAccessService
]
)
{
const
commonUserDoLoginResult1
=
await
commonUserService
.
doLogin
(
userInfo
,
vipInfo
,
activityInfo
)
const
commonAccessAddAccessResult2
=
await
commonAccessService
.
addAccess
(
commonUserDoLoginResult1
,
vipInfo
)
return
resultsModel
.
success
({
...
commonUserDoLoginResult1
,
...
commonAccessAddAccessResult2
})
}
}
v2.0/src/controller/share.controller.ts
View file @
8c8a77ad
...
...
@@ -40,7 +40,7 @@ export default class Share {
context
:
IContext
<
IParams
>
,
{
userInfo
,
activityInfo
,
inviteUserInfo
}:
IdoHelpInfos
,
[
taskService
,
statService
]:
[
CommonTaskService
,
CommonStatService
]
)
:
Promise
<
IResult
<
boolean
>>
{
)
{
const
{
openId
}
=
context
const
result
=
await
taskService
.
completeTask
(
'invites'
,
activityInfo
,
inviteUserInfo
)
...
...
v2.0/src/controller/task.controller.ts
View file @
8c8a77ad
...
...
@@ -44,7 +44,7 @@ export default class Task {
context
:
IContext
<
IParams
>
,
{
userInfo
,
activityInfo
}:
IControllerInfos
,
[
taskService
]:
[
CommonTaskService
]
)
:
Promise
<
IResult
<
boolean
>>
{
)
{
const
{
taskType
}
=
context
.
data
// 更新user表
...
...
v2.0/src/index.ts
View file @
8c8a77ad
...
...
@@ -3,6 +3,10 @@ import CommonUserController from './controller/common/user.controller'
const
CommonUserControllerInstance
=
new
CommonUserController
()
import
CommonTaskController
from
'./controller/common/task.controller'
const
CommonTaskControllerInstance
=
new
CommonTaskController
()
import
CommonLoginController
from
'./controller/common/login.controller'
const
CommonLoginControllerInstance
=
new
CommonLoginController
()
import
CommonBaseController
from
'./controller/common/base.controller'
const
CommonBaseControllerInstance
=
new
CommonBaseController
()
import
CommonStatController
from
'./controller/common/stat.controller'
const
CommonStatControllerInstance
=
new
CommonStatController
()
import
CustomTest1Controller
from
'./controller/custom/test1.controller'
...
...
@@ -17,6 +21,8 @@ export default {
commonTaskDocompletetask
:
CommonTaskControllerInstance
.
doCompleteTask
,
commonTaskReceivetaskrewards
:
CommonTaskControllerInstance
.
receiveTaskRewards
,
commonTaskGetcollectgoodslist
:
CommonTaskControllerInstance
.
getCollectGoodsList
,
commonLoginLogin
:
CommonLoginControllerInstance
.
login
,
commonBaseGetactivitybaseinfobyid
:
CommonBaseControllerInstance
.
getActivityBaseInfoById
,
commonStatAddstat
:
CommonStatControllerInstance
.
addStat
,
commonStatGetstats
:
CommonStatControllerInstance
.
getStats
,
customTest1Addstat
:
CustomTest1ControllerInstance
.
addStat
,
...
...
v2.0/src/service/common/task.service.ts
View file @
8c8a77ad
...
...
@@ -112,12 +112,7 @@ export default class TaskService extends UserService {
* @returns {boolean}
* @memberof TaskService
*/
async
completeTask
(
taskType
:
ITaskType
,
activityInfo
:
IActivityInfo
,
userInfo
:
IUserInfo
,
customRecord
:
Object
=
{}
):
Promise
<
boolean
|
ICodeType
>
{
async
completeTask
(
taskType
:
ITaskType
,
activityInfo
:
IActivityInfo
,
userInfo
:
IUserInfo
,
customRecord
:
Object
=
{})
{
const
today
=
getToday
()
const
rewards
=
activityInfo
?.
tasks
?.[
taskType
]?.
value
||
0
const
{
...
...
@@ -134,7 +129,7 @@ export default class TaskService extends UserService {
[
`taskInfo.
${
today
}
.
${
taskType
}
`
]:
{
...
record
,
createTime
:
Date
.
now
()
}
}
})
return
result
?
true
:
CODE_TYPES
.
ERROR_DO_TASK
return
result
?
{
ok
:
1
}
:
CODE_TYPES
.
ERROR_DO_TASK
}
// 根据下单下单记录,更新状态
...
...
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