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
abba0476
Commit
abba0476
authored
Jun 20, 2023
by
iamhujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:medals是必须的
parent
406e236f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
1 deletion
+11
-1
user.go
cv/user_cv/user.go
+2
-0
utils.go
cv/user_cv/utils.go
+7
-0
user.go
domain/service/user_s/user.go
+1
-0
user.go
route/user_r/user.go
+1
-1
No files found.
cv/user_cv/user.go
View file @
abba0476
...
@@ -100,6 +100,7 @@ type CvUserBase struct {
...
@@ -100,6 +100,7 @@ type CvUserBase struct {
//VIP用户过期时间(只有自己查询自己,才返回)
//VIP用户过期时间(只有自己查询自己,才返回)
VipExpireTime
*
int64
`json:"vipExpireTime"`
VipExpireTime
*
int64
`json:"vipExpireTime"`
Svip
rpc
.
CvSvip
`json:"svip"`
// svip结构,等级+权限
Svip
rpc
.
CvSvip
`json:"svip"`
// svip结构,等级+权限
Medals
[]
uint32
`json:"medals"`
// 勋章列表
MedalInfo
[]
medal_cv
.
CvMedal
`json:"medalInfo"`
// 勋章列表
MedalInfo
[]
medal_cv
.
CvMedal
`json:"medalInfo"`
// 勋章列表
Headwear
*
headwear_cv
.
CvHeadwear
`json:"headwear"`
// 当前使用的头饰
Headwear
*
headwear_cv
.
CvHeadwear
`json:"headwear"`
// 当前使用的头饰
Ride
property_cv
.
CvProperty
`json:"ride"`
// 当前使用的座驾
Ride
property_cv
.
CvProperty
`json:"ride"`
// 当前使用的座驾
...
@@ -191,6 +192,7 @@ func GetUserBases(userIds []mysql.ID, myUserId mysql.ID) ([]*CvUserBase, error)
...
@@ -191,6 +192,7 @@ func GetUserBases(userIds []mysql.ID, myUserId mysql.ID) ([]*CvUserBase, error)
IsPrettyCode
:
user
.
IsPrettyCode
(),
IsPrettyCode
:
user
.
IsPrettyCode
(),
IsVip
:
vips
[
user
.
ID
]
!=
nil
,
IsVip
:
vips
[
user
.
ID
]
!=
nil
,
IsOfficialStaff
:
superManagerMap
[
user
.
ID
],
IsOfficialStaff
:
superManagerMap
[
user
.
ID
],
Medals
:
IfLogoutMedals
(
IfLogout
(
user
.
LogoutTime
),
[]
uint32
{},
medals
[
user
.
ID
]),
MedalInfo
:
IfLogoutMedalInfo
(
invisible
,
[]
medal_cv
.
CvMedal
{},
medalInfo
[
user
.
ID
]),
MedalInfo
:
IfLogoutMedalInfo
(
invisible
,
[]
medal_cv
.
CvMedal
{},
medalInfo
[
user
.
ID
]),
Ride
:
IfLogoutRide
(
IfLogout
(
user
.
LogoutTime
),
property_cv
.
CvProperty
{},
property_cv
.
CvProperty
{
Ride
:
IfLogoutRide
(
IfLogout
(
user
.
LogoutTime
),
property_cv
.
CvProperty
{},
property_cv
.
CvProperty
{
Id
:
rides
[
user
.
ID
],
Id
:
rides
[
user
.
ID
],
...
...
cv/user_cv/utils.go
View file @
abba0476
...
@@ -78,6 +78,13 @@ func IfLogout(logoutTime int64) bool {
...
@@ -78,6 +78,13 @@ func IfLogout(logoutTime int64) bool {
return
logoutTime
>
0
&&
time
.
Now
()
.
Unix
()
>
logoutTime
return
logoutTime
>
0
&&
time
.
Now
()
.
Unix
()
>
logoutTime
}
}
func
IfLogoutMedals
(
condition
bool
,
trueVal
,
falseVal
[]
uint32
)
[]
uint32
{
if
condition
{
return
trueVal
}
return
falseVal
}
func
IfLogoutMedalInfo
(
condition
bool
,
trueVal
,
falseVal
[]
medal_cv
.
CvMedal
)
[]
medal_cv
.
CvMedal
{
func
IfLogoutMedalInfo
(
condition
bool
,
trueVal
,
falseVal
[]
medal_cv
.
CvMedal
)
[]
medal_cv
.
CvMedal
{
if
condition
{
if
condition
{
return
trueVal
return
trueVal
...
...
domain/service/user_s/user.go
View file @
abba0476
...
@@ -285,6 +285,7 @@ func userToDetailOne(model *domain.Model, user *user_m.User, myUserId mysql.ID,
...
@@ -285,6 +285,7 @@ func userToDetailOne(model *domain.Model, user *user_m.User, myUserId mysql.ID,
IsOfficialStaff
:
isOfficialStaff
,
IsOfficialStaff
:
isOfficialStaff
,
VipExpireTime
:
vipExpireTime
,
VipExpireTime
:
vipExpireTime
,
Svip
:
svip
,
Svip
:
svip
,
Medals
:
IfLogoutMedals
(
IfLogout
(
user
.
LogoutTime
),
[]
uint32
{},
medals
),
MedalInfo
:
IfLogoutMedalInfo
(
IfLogout
(
user
.
LogoutTime
),
[]
medal_cv
.
CvMedal
{},
medalInfo
),
MedalInfo
:
IfLogoutMedalInfo
(
IfLogout
(
user
.
LogoutTime
),
[]
medal_cv
.
CvMedal
{},
medalInfo
),
Headwear
:
IfLogoutHeadwear
(
IfLogout
(
user
.
LogoutTime
),
nil
,
headwear
),
Headwear
:
IfLogoutHeadwear
(
IfLogout
(
user
.
LogoutTime
),
nil
,
headwear
),
Ride
:
IfLogoutRide
(
IfLogout
(
user
.
LogoutTime
),
property_cv
.
CvProperty
{},
ride
),
Ride
:
IfLogoutRide
(
IfLogout
(
user
.
LogoutTime
),
property_cv
.
CvProperty
{},
ride
),
...
...
route/user_r/user.go
View file @
abba0476
...
@@ -89,7 +89,7 @@ func UserDetailByExternalId(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -89,7 +89,7 @@ func UserDetailByExternalId(c *gin.Context) (*mycontext.MyContext, error) {
if
n
==
0
{
if
n
==
0
{
// FIXME:转异步执行
// FIXME:转异步执行
err
=
tim_m
.
FlushHiloInfo
(
*
cvUserDetail
.
ExternalId
,
cvUserDetail
.
IsVip
,
cvUserDetail
.
IsPrettyCode
,
err
=
tim_m
.
FlushHiloInfo
(
*
cvUserDetail
.
ExternalId
,
cvUserDetail
.
IsVip
,
cvUserDetail
.
IsPrettyCode
,
nil
,
cvUserDetail
.
MyGroupPowerName
,
cvUserDetail
.
Noble
.
Level
)
cvUserDetail
.
Medals
,
cvUserDetail
.
MyGroupPowerName
,
cvUserDetail
.
Noble
.
Level
)
if
err
==
nil
{
if
err
==
nil
{
redisCli
.
GetRedis
()
.
Set
(
model
,
user_k
.
GetKeySyncTimHilo
(
userId
),
"1"
,
time
.
Minute
)
redisCli
.
GetRedis
()
.
Set
(
model
,
user_k
.
GetKeySyncTimHilo
(
userId
),
"1"
,
time
.
Minute
)
}
else
{
}
else
{
...
...
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