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
137c7c80
Commit
137c7c80
authored
Mar 20, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:调整
parent
41a0b694
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
11 deletions
+4
-11
group_rank.go
cv/group_power_cv/group_rank.go
+0
-5
group_rank.go
route/group_power_r/group_rank.go
+4
-6
No files found.
cv/group_power_cv/group_rank.go
View file @
137c7c80
...
...
@@ -40,11 +40,6 @@ type CvGroupPowerRank struct {
Items
[]
CvGroupPowerRankData
`json:"items"`
// 列表
}
type
CvGroupPowerRankTop3
struct
{
Period
string
`json:"period"`
// 榜单周期 day:日 week:周 month:月
Items
[]
CvGroupPowerRankData
`json:"items"`
// 列表
}
type
CvGroupPowerRankData
struct
{
CvGroupPowerBase
`json:",inline"`
CvGroupPowerGrade
`json:",inline"`
...
...
route/group_power_r/group_rank.go
View file @
137c7c80
...
...
@@ -24,7 +24,7 @@ import (
// @Param token header string true "token"
// @Param nonce header string true "随机数字"
// @Param period path string true "榜单周期 day:日 week:周 month:月"
// @Success 200 {object} []group_power_cv.CvGroupPowerRank
Top3
// @Success 200 {object} []group_power_cv.CvGroupPowerRank
// @Router /v1/groupPower/rank/{period} [get]
func
GroupPowerRank
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
myContext
:=
mycontext
.
CreateMyContext
(
c
.
Keys
)
...
...
@@ -111,12 +111,12 @@ func GroupPowerRank(c *gin.Context) (*mycontext.MyContext, error) {
// @Summary 家族日周月榜单top3
// @Param token header string true "token"
// @Param nonce header string true "随机数字"
// @Success 200 {object}
[]group_power_cv.CvGroupPowerRankTop3
// @Success 200 {object}
map[string][]group_power_cv.CvGroupPowerRankData
// @Router /v1/groupPower/rankTop [get]
func
GroupPowerRankTop
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
myContext
:=
mycontext
.
CreateMyContext
(
c
.
Keys
)
periods
:=
[]
string
{
"day"
,
"week"
,
"month"
}
var
response
[]
group_power_cv
.
CvGroupPowerRankTop3
var
response
=
make
(
map
[
string
][]
group_power_cv
.
CvGroupPowerRankData
)
for
_
,
period
:=
range
periods
{
var
beginDate
,
endDate
string
switch
period
{
...
...
@@ -145,9 +145,8 @@ func GroupPowerRankTop(c *gin.Context) (*mycontext.MyContext, error) {
if
err
!=
nil
{
return
myContext
,
err
}
data
:=
group_power_cv
.
CvGroupPowerRankTop3
{
Period
:
period
}
for
_
,
v
:=
range
rank
{
data
.
Items
=
append
(
data
.
Items
,
group_power_cv
.
CvGroupPowerRankData
{
response
[
period
]
=
append
(
response
[
period
]
,
group_power_cv
.
CvGroupPowerRankData
{
CvGroupPowerBase
:
group_power_cv
.
CvGroupPowerBase
{
Id
:
v
.
GroupPowerId
,
Icon
:
groupPowers
[
v
.
GroupPowerId
]
.
Icon
,
...
...
@@ -161,7 +160,6 @@ func GroupPowerRankTop(c *gin.Context) (*mycontext.MyContext, error) {
Rank
:
v
.
Rank
,
})
}
response
=
append
(
response
,
data
)
}
resp
.
ResponseOk
(
c
,
response
)
return
myContext
,
nil
...
...
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