Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-user
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
chenweijian
hilo-user
Commits
9f484583
Commit
9f484583
authored
Aug 03, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/user-svip-vip-level' into 'master'
Feature/user svip vip level See merge request
!26
parents
3b64f2b4
2b3539ad
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
1 deletion
+60
-1
router.go
route/router.go
+2
-1
inner.go
route/user_r/inner.go
+58
-0
No files found.
route/router.go
View file @
9f484583
...
...
@@ -77,6 +77,7 @@ func InitRouter() *gin.Engine {
innerUser
.
GET
(
"/cpRelations"
,
wrapper
(
user_r
.
MGetUserCpRelation
))
innerUser
.
GET
(
"/cp/pair"
,
wrapper
(
user_r
.
GetUserCpPair
))
innerUser
.
GET
(
"/cp/entryEffect"
,
wrapper
(
user_r
.
GetUserCpEntryEffect
))
// 获取cp进场特效信息,高频接口,需要额外处理
innerUser
.
GET
(
"/svipNobleLevel"
,
wrapper
(
user_r
.
MGetUserSvipNobleLevel
))
// 获取用户svip/noble/level等信息
}
// 道具相关
innerProp
:=
inner
.
Group
(
"/prop"
)
...
...
route/user_r/inner.go
View file @
9f484583
...
...
@@ -4,9 +4,11 @@ import (
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/rpc"
"github.com/gin-gonic/gin"
"hilo-user/_const/enum/cp_e"
"hilo-user/cv/cp_cv"
"hilo-user/cv/noble_cv"
"hilo-user/cv/user_cv"
"hilo-user/domain/cache/user_c"
"hilo-user/domain/model/bag_m"
...
...
@@ -56,6 +58,62 @@ func MGetUserLevels(c *gin.Context) (*mycontext.MyContext, error) {
return
myCtx
,
nil
}
type
MGetUserSvipVipLevelReq
struct
{
Ids
[]
mysql
.
ID
`form:"ids" binding:"required"`
}
// @Tags 用户-内部
// @Summary 批量获取用户等级
// @Param ids query string true "用户id,如:ids=1&ids=2&ids=3"
// @Success 200 {object} user_cv.CvUserDetail
// @Router /inner/user/svipNobleLevel [get]
func
MGetUserSvipNobleLevel
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
myCtx
:=
mycontext
.
CreateMyContext
(
c
.
Keys
)
var
model
=
domain
.
CreateModelContext
(
myCtx
)
var
req
MGetUserLevelReq
if
err
:=
c
.
ShouldBindQuery
(
&
req
);
err
!=
nil
{
return
myCtx
,
err
}
wealthGrade
,
err
:=
user_m
.
MGetWealthGrade
(
model
,
req
.
Ids
)
if
err
!=
nil
{
return
myCtx
,
err
}
charmGrade
,
err
:=
user_m
.
MGetCharmGrade
(
model
,
req
.
Ids
)
activeGrade
,
err
:=
user_m
.
MGetActiveGrade
(
model
,
req
.
Ids
)
nobleLevel
,
err
:=
noble_m
.
BatchGetNobleLevel
(
model
,
req
.
Ids
)
svip
,
err
:=
rpc
.
MGetUserSvip
(
model
,
req
.
Ids
)
users
,
err
:=
user_m
.
GetUserMapByIds
(
model
,
req
.
Ids
)
response
:=
make
(
map
[
uint64
]
user_cv
.
CvUserDetail
)
for
_
,
userId
:=
range
req
.
Ids
{
user
:=
users
[
userId
]
response
[
userId
]
=
user_cv
.
CvUserDetail
{
CvUserBase
:
user_cv
.
CvUserBase
{
Id
:
&
user
.
ID
,
Avatar
:
&
user
.
Avatar
,
ExternalId
:
&
user
.
ExternalId
,
Nick
:
&
user
.
Nick
,
Sex
:
&
user
.
Sex
,
Country
:
&
user
.
Country
,
CountryIcon
:
&
user
.
CountryIcon
,
Code
:
&
user
.
Code
,
Birthday
:
&
user
.
Birthday
,
Svip
:
rpc
.
CvSvip
{
SvipLevel
:
svip
[
userId
]
.
SvipLevel
,
},
Noble
:
noble_cv
.
CvNoble
{
Level
:
nobleLevel
[
userId
],
},
},
WealthUserGrade
:
wealthGrade
[
userId
],
CharmUserGrade
:
charmGrade
[
userId
],
ActivityUserGrade
:
activeGrade
[
userId
],
}
}
resp
.
ResponseOk
(
c
,
response
)
return
myCtx
,
nil
}
type
GetUserBagReq
struct
{
BagId
mysql
.
ID
`form:"bagId" binding:"required"`
}
...
...
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