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
e2d2a8ee
Commit
e2d2a8ee
authored
Jul 14, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
是否新用户
parent
b4a8d86c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
user.go
cv/user_cv/user.go
+5
-0
user.go
domain/service/user_s/user.go
+2
-0
No files found.
cv/user_cv/user.go
View file @
e2d2a8ee
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"git.hilo.cn/hilo-common/mylogrus"
"git.hilo.cn/hilo-common/mylogrus"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/rpc"
"git.hilo.cn/hilo-common/rpc"
"git.hilo.cn/hilo-common/utils"
"gorm.io/gorm"
"gorm.io/gorm"
"hilo-user/_const/enum/country_e"
"hilo-user/_const/enum/country_e"
"hilo-user/_const/enum/cp_e"
"hilo-user/_const/enum/cp_e"
...
@@ -97,6 +98,8 @@ type CvUserBase struct {
...
@@ -97,6 +98,8 @@ type CvUserBase struct {
IsVip
bool
`json:"isVip"`
IsVip
bool
`json:"isVip"`
//是否是官方人员
//是否是官方人员
IsOfficialStaff
bool
`json:"isOfficialStaff"`
IsOfficialStaff
bool
`json:"isOfficialStaff"`
//是否新用户(注册7天内)
IsNew
bool
`json:"isNew"`
//VIP用户过期时间(只有自己查询自己,才返回)
//VIP用户过期时间(只有自己查询自己,才返回)
VipExpireTime
*
int64
`json:"vipExpireTime"`
VipExpireTime
*
int64
`json:"vipExpireTime"`
Svip
rpc
.
CvSvip
`json:"svip"`
// svip结构,等级+权限
Svip
rpc
.
CvSvip
`json:"svip"`
// svip结构,等级+权限
...
@@ -215,6 +218,7 @@ func GetUserBases(userIds []mysql.ID, myUserId mysql.ID) ([]*CvUserBase, error)
...
@@ -215,6 +218,7 @@ func GetUserBases(userIds []mysql.ID, myUserId mysql.ID) ([]*CvUserBase, error)
Level
:
nobles
[
user
.
ID
]
.
Level
,
Level
:
nobles
[
user
.
ID
]
.
Level
,
EndTime
:
nobles
[
user
.
ID
]
.
EndTime
.
Unix
(),
EndTime
:
nobles
[
user
.
ID
]
.
EndTime
.
Unix
(),
},
},
IsNew
:
utils
.
IsNewUser
(
user
.
Birthday
),
}
}
if
cvUserBase
.
Noble
.
Level
<=
0
{
if
cvUserBase
.
Noble
.
Level
<=
0
{
cvUserBase
.
Noble
.
EndTime
=
0
cvUserBase
.
Noble
.
EndTime
=
0
...
@@ -304,6 +308,7 @@ func GetUserBasesForCp(userIds []mysql.ID) ([]*CvUserBase, error) {
...
@@ -304,6 +308,7 @@ func GetUserBasesForCp(userIds []mysql.ID) ([]*CvUserBase, error) {
Level
:
nobles
[
user
.
ID
]
.
Level
,
Level
:
nobles
[
user
.
ID
]
.
Level
,
EndTime
:
nobles
[
user
.
ID
]
.
EndTime
.
Unix
(),
EndTime
:
nobles
[
user
.
ID
]
.
EndTime
.
Unix
(),
},
},
IsNew
:
utils
.
IsNewUser
(
user
.
Birthday
),
}
}
if
cvUserBase
.
Noble
.
Level
<=
0
{
if
cvUserBase
.
Noble
.
Level
<=
0
{
cvUserBase
.
Noble
.
EndTime
=
0
cvUserBase
.
Noble
.
EndTime
=
0
...
...
domain/service/user_s/user.go
View file @
e2d2a8ee
...
@@ -5,6 +5,7 @@ import (
...
@@ -5,6 +5,7 @@ import (
"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"
"git.hilo.cn/hilo-common/rpc"
"git.hilo.cn/hilo-common/utils"
"gorm.io/gorm"
"gorm.io/gorm"
"hilo-user/_const/enum/user_e"
"hilo-user/_const/enum/user_e"
"hilo-user/cv/headwear_cv"
"hilo-user/cv/headwear_cv"
...
@@ -293,6 +294,7 @@ func userToDetailOne(model *domain.Model, user *user_m.User, myUserId mysql.ID,
...
@@ -293,6 +294,7 @@ func userToDetailOne(model *domain.Model, user *user_m.User, myUserId mysql.ID,
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
),
IsNew
:
utils
.
IsNewUser
(
user
.
Birthday
),
},
},
IsPush
:
TypeToUint8
(
&
user
.
IsPush
),
IsPush
:
TypeToUint8
(
&
user
.
IsPush
),
IsLike
:
&
isLike
,
IsLike
:
&
isLike
,
...
...
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