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
fd939999
Commit
fd939999
authored
Jun 13, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:称号翻译
parent
c89a1938
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
level.go
_const/enum/cp_e/level.go
+8
-0
space.go
cv/cp_cv/space.go
+1
-0
inner.go
route/user_r/inner.go
+10
-2
No files found.
_const/enum/cp_e/level.go
View file @
fd939999
...
...
@@ -38,6 +38,14 @@ var (
CpLevel4
:
"icon4.png"
,
CpLevel5
:
"icon5.png"
,
}
// cp等级称号
CpLevelTitle
=
map
[
CpLevel
]
uint
{
CpLevel1
:
252
,
CpLevel2
:
253
,
CpLevel3
:
254
,
CpLevel4
:
255
,
CpLevel5
:
256
,
}
// cp特权名称
CpPrivilegeNameMsgId
=
map
[
CpPrivilege
]
uint
{
CpPrivilegeSpace
:
234
,
...
...
cv/cp_cv/space.go
View file @
fd939999
...
...
@@ -28,6 +28,7 @@ type CvCpLevel struct {
ExpireAtUnix
int64
`json:"expireAtUnix,omitempty"`
// 有效期,时间戳
SettlementDate
string
`json:"settlementDate"`
// 等级过期时间
MaxLevel
cp_e
.
CpLevel
`json:"maxLevel"`
// cp最大的等级
Title
string
`json:"title,omitempty"`
// 称号翻译
}
// 资源等级
...
...
route/user_r/inner.go
View file @
fd939999
...
...
@@ -95,12 +95,14 @@ func GetUserBagId(c *gin.Context) (*mycontext.MyContext, error) {
}
type
GetUserCpReq
struct
{
Id
mysql
.
ID
`form:"id" binding:"required"`
Id
mysql
.
ID
`form:"id" binding:"required"`
Language
string
`form:"language"`
}
// @Tags 用户-内部
// @Summary 获取用户cp
// @Param id query int true "用户id"
// @Param language query string true "语言"
// @Success 200 {object} cp_cv.CvCp
// @Router /inner/user/cp [get]
func
GetUserCp
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
...
...
@@ -151,10 +153,16 @@ func GetUserCp(c *gin.Context) (*mycontext.MyContext, error) {
return
myContext
,
err
}
// 返回值
title
:=
""
if
msgId
,
ok
:=
cp_e
.
CpLevelTitle
[
level
.
Level
];
ok
{
title
=
cp_cv
.
GetTranslate
(
msgId
,
req
.
Language
)
}
response
=
cp_cv
.
CvCp
{
CpUserInfo
:
userBases
[
cpUserId
],
CpLevel
:
cp_cv
.
CvCpLevel
{
Level
:
cpLevel
,
Level
:
cpLevel
,
Points
:
cp_e
.
CpLevelPoints
[
cpLevel
]
+
level
.
Points
,
Title
:
title
,
},
MyPrivilegeList
:
myPrivilegeList
,
}
...
...
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