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
Compare Revisions
master...feature/user-svip-vip-level
Source
feature/user-svip-vip-level
Select Git revision
...
Target
master
Select Git revision
Compare
Commits (2)
获取用户svip/noble/level等信息
· b0859340
hujiebin
authored
Aug 03, 2023
b0859340
年龄
· 2e2bbb17
hujiebin
authored
Aug 03, 2023
2e2bbb17
Hide 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 @
2e2bbb17
...
@@ -76,7 +76,8 @@ func InitRouter() *gin.Engine {
...
@@ -76,7 +76,8 @@ func InitRouter() *gin.Engine {
innerUser
.
GET
(
"/cp"
,
wrapper
(
user_r
.
GetUserCp
))
innerUser
.
GET
(
"/cp"
,
wrapper
(
user_r
.
GetUserCp
))
innerUser
.
GET
(
"/cpRelations"
,
wrapper
(
user_r
.
MGetUserCpRelation
))
innerUser
.
GET
(
"/cpRelations"
,
wrapper
(
user_r
.
MGetUserCpRelation
))
innerUser
.
GET
(
"/cp/pair"
,
wrapper
(
user_r
.
GetUserCpPair
))
innerUser
.
GET
(
"/cp/pair"
,
wrapper
(
user_r
.
GetUserCpPair
))
innerUser
.
GET
(
"/cp/entryEffect"
,
wrapper
(
user_r
.
GetUserCpEntryEffect
))
// 获取cp进场特效信息,高频接口,需要额外处理
innerUser
.
GET
(
"/cp/entryEffect"
,
wrapper
(
user_r
.
GetUserCpEntryEffect
))
// 获取cp进场特效信息,高频接口,需要额外处理
innerUser
.
GET
(
"/svipNobleLevel"
,
wrapper
(
user_r
.
MGetUserSvipNobleLevel
))
// 获取用户svip/noble/level等信息
}
}
// 道具相关
// 道具相关
innerProp
:=
inner
.
Group
(
"/prop"
)
innerProp
:=
inner
.
Group
(
"/prop"
)
...
...
route/user_r/inner.go
View file @
2e2bbb17
...
@@ -4,9 +4,11 @@ import (
...
@@ -4,9 +4,11 @@ import (
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/mycontext"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/rpc"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin"
"hilo-user/_const/enum/cp_e"
"hilo-user/_const/enum/cp_e"
"hilo-user/cv/cp_cv"
"hilo-user/cv/cp_cv"
"hilo-user/cv/noble_cv"
"hilo-user/cv/user_cv"
"hilo-user/cv/user_cv"
"hilo-user/domain/cache/user_c"
"hilo-user/domain/cache/user_c"
"hilo-user/domain/model/bag_m"
"hilo-user/domain/model/bag_m"
...
@@ -56,6 +58,62 @@ func MGetUserLevels(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -56,6 +58,62 @@ func MGetUserLevels(c *gin.Context) (*mycontext.MyContext, error) {
return
myCtx
,
nil
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
{
type
GetUserBagReq
struct
{
BagId
mysql
.
ID
`form:"bagId" binding:"required"`
BagId
mysql
.
ID
`form:"bagId" binding:"required"`
}
}
...
...