Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hilo-group
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
hujiebin
hilo-group
Commits
f8a28240
Commit
f8a28240
authored
Jul 25, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口优化
parent
6daa60a6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
16 deletions
+22
-16
billboard.go
cv/billboard_cv/billboard.go
+11
-4
group.go
cv/group_cv/group.go
+0
-12
user.go
cv/user_cv/user.go
+11
-0
No files found.
cv/billboard_cv/billboard.go
View file @
f8a28240
...
...
@@ -8,7 +8,6 @@ import (
"hilo-group/_const/enum/gift_e"
"hilo-group/_const/redis_key"
"hilo-group/cv/gift_cv"
"hilo-group/cv/group_cv"
"hilo-group/cv/user_cv"
"sort"
"strconv"
...
...
@@ -26,7 +25,7 @@ type BillboardUserInfo struct {
//榜单中用户信息
type
GroupTop3ConsumeUser
struct
{
//用户基本信息
UserBase
group
_cv
.
TopConsumersUser
`json:"userBase"`
UserBase
user
_cv
.
TopConsumersUser
`json:"userBase"`
//数值
Num
uint64
`json:"num"`
}
...
...
@@ -68,7 +67,15 @@ func GetGroupTop3Consume(model *domain.Model, groupId string, myUserId uint64) (
ret
,
err
:=
saveGroupTop3Consume
(
period
,
groupId
,
diamonds
)
model
.
Log
.
Infof
(
"GetGroupTop3Consume SAVE ret = %d, err: %v"
,
ret
,
err
)
return
result
,
nil
list
:=
make
([]
GroupTop3ConsumeUser
,
0
,
len
(
result
))
for
_
,
v
:=
range
result
{
list
=
append
(
list
,
GroupTop3ConsumeUser
{
UserBase
:
user_cv
.
TopConsumersUser
{
Id
:
v
.
UserBase
.
Id
,
Avatar
:
v
.
UserBase
.
Avatar
,
ExternalId
:
v
.
UserBase
.
ExternalId
,
Nick
:
v
.
UserBase
.
Nick
},
})
}
return
list
,
nil
}
userIds
:=
make
([]
uint64
,
0
)
...
...
@@ -99,7 +106,7 @@ func GetGroupTop3Consume(model *domain.Model, groupId string, myUserId uint64) (
list
:=
make
([]
GroupTop3ConsumeUser
,
0
,
len
(
result
))
for
_
,
v
:=
range
result
{
list
=
append
(
list
,
GroupTop3ConsumeUser
{
UserBase
:
group
_cv
.
TopConsumersUser
{
Id
:
v
.
UserBase
.
Id
,
Avatar
:
v
.
UserBase
.
Avatar
,
ExternalId
:
v
.
UserBase
.
ExternalId
,
Nick
:
v
.
UserBase
.
Nick
},
UserBase
:
user
_cv
.
TopConsumersUser
{
Id
:
v
.
UserBase
.
Id
,
Avatar
:
v
.
UserBase
.
Avatar
,
ExternalId
:
v
.
UserBase
.
ExternalId
,
Nick
:
v
.
UserBase
.
Nick
},
})
}
...
...
cv/group_cv/group.go
View file @
f8a28240
...
...
@@ -2,7 +2,6 @@ package group_cv
import
(
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/resource/mysql"
"git.hilo.cn/hilo-common/utils"
"hilo-group/_const/enum/game_e"
"hilo-group/_const/enum/groupPower_e"
...
...
@@ -147,17 +146,6 @@ type GroupDetail struct {
Owner
*
user_cv
.
CvUserDetail
`json:"owner"`
// 群主信息
}
type
TopConsumersUser
struct
{
//不会有返回值
Id
*
mysql
.
ID
`json:"id,omitempty"`
//头像,不存在为nil
Avatar
*
string
`json:"avatar"`
//用户对外ID
ExternalId
*
string
`json:"externalId"`
//昵称,不存在为nil
Nick
*
string
`json:"nick"`
}
type
SimpleRoleInfo
struct
{
ExternalId
string
`json:"externalId"`
Role
group_e
.
GroupRoleType
`json:"role"`
...
...
cv/user_cv/user.go
View file @
f8a28240
...
...
@@ -1324,3 +1324,14 @@ func UserDetailToRoomInfoOwner(user *CvUserDetail) *RoomInfoOwner {
GroupPower
:
user
.
GroupPower
,
}
}
type
TopConsumersUser
struct
{
//不会有返回值
Id
*
mysql
.
ID
`json:"id,omitempty"`
//头像,不存在为nil
Avatar
*
string
`json:"avatar"`
//用户对外ID
ExternalId
*
string
`json:"externalId"`
//昵称,不存在为nil
Nick
*
string
`json:"nick"`
}
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