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
312d9a7a
Commit
312d9a7a
authored
Jul 14, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
是否新用户
parent
a60fd927
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
user.go
cv/user_cv/user.go
+4
-1
user.go
domain/model/user_m/user.go
+5
-0
user.go
domain/service/user_s/user.go
+1
-0
No files found.
cv/user_cv/user.go
View file @
312d9a7a
...
...
@@ -84,7 +84,8 @@ type CvUserBase struct {
//邀请码
Code
*
string
`json:"code"`
IsPrettyCode
bool
`json:"isPrettyCode"`
// 是否靓号
IsLogout
bool
`json:"isLogout"`
//是否注销
IsNew
bool
`json:"isNew"`
// 是否新用户
IsLogout
bool
`json:"isLogout"`
// 是否注销
//生日,如果是其它人用户信息,年龄则按照是否展示显示,如果是本人,年龄则按照是否存在展示
Birthday
*
uint64
`json:"birthday"`
//是否展示年龄, 是本人才有数据,看其他用户均为nil
...
...
@@ -201,6 +202,7 @@ func GetUserBases(userIds []mysql.ID, myUserId mysql.ID) ([]*CvUserBase, error)
CountryIcon
:
StrNil
(
user
.
CountryIcon
),
Code
:
StrToString
(
&
user
.
Code
),
IsPrettyCode
:
user
.
IsPrettyCode
(),
IsNew
:
user
.
IsNew
(),
IsVip
:
vips
[
user
.
ID
]
!=
nil
,
IsOfficialStaff
:
superManagerMap
[
user
.
ID
],
Medals
:
IfLogoutMedals
(
IfLogout
(
user
.
LogoutTime
),
[]
uint32
{},
medals
[
user
.
ID
]),
...
...
@@ -301,6 +303,7 @@ func GetUserBasesForCp(userIds []mysql.ID) ([]*CvUserBase, error) {
CountryIcon
:
StrNil
(
user
.
CountryIcon
),
Code
:
StrToString
(
&
user
.
Code
),
IsPrettyCode
:
user
.
IsPrettyCode
(),
IsNew
:
user
.
IsNew
(),
IsVip
:
vips
[
user
.
ID
]
!=
nil
,
Noble
:
noble_cv
.
CvNoble
{
Level
:
nobles
[
user
.
ID
]
.
Level
,
...
...
domain/model/user_m/user.go
View file @
312d9a7a
...
...
@@ -52,6 +52,11 @@ func (u User) IsPrettyCode() bool {
return
u
.
Code
!=
u
.
OriginCode
}
// 七天内注册
func
(
u
User
)
IsNew
()
bool
{
return
time
.
Now
()
.
Sub
(
u
.
CreatedTime
)
.
Hours
()
<
24
*
7
}
//获取用户
func
GetUser
(
model
*
domain
.
Model
,
id
mysql
.
ID
)
(
*
User
,
error
)
{
var
user
User
...
...
domain/service/user_s/user.go
View file @
312d9a7a
...
...
@@ -285,6 +285,7 @@ func userToDetailOne(model *domain.Model, user *user_m.User, myUserId mysql.ID,
CountryIcon
:
StrNil
(
user
.
CountryIcon
),
Code
:
StrToString
(
&
user
.
Code
),
IsPrettyCode
:
user
.
IsPrettyCode
(),
IsNew
:
user
.
IsNew
(),
IsVip
:
isVip
,
IsOfficialStaff
:
isOfficialStaff
,
VipExpireTime
:
vipExpireTime
,
...
...
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