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
52253598
Commit
52253598
authored
Jun 13, 2023
by
hujiebin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/cp-new' into feature/3.9.0
parents
2d562c8f
db47bb04
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
2 deletions
+25
-2
level.go
_const/enum/cp_e/level.go
+8
-0
space.go
cv/cp_cv/space.go
+1
-0
middleHandle.go
route/middleHandle.go
+6
-0
inner.go
route/user_r/inner.go
+10
-2
No files found.
_const/enum/cp_e/level.go
View file @
52253598
...
@@ -38,6 +38,14 @@ var (
...
@@ -38,6 +38,14 @@ var (
CpLevel4
:
"icon4.png"
,
CpLevel4
:
"icon4.png"
,
CpLevel5
:
"icon5.png"
,
CpLevel5
:
"icon5.png"
,
}
}
// cp等级称号
CpLevelTitle
=
map
[
CpLevel
]
uint
{
CpLevel1
:
252
,
CpLevel2
:
253
,
CpLevel3
:
254
,
CpLevel4
:
255
,
CpLevel5
:
256
,
}
// cp特权名称
// cp特权名称
CpPrivilegeNameMsgId
=
map
[
CpPrivilege
]
uint
{
CpPrivilegeNameMsgId
=
map
[
CpPrivilege
]
uint
{
CpPrivilegeSpace
:
234
,
CpPrivilegeSpace
:
234
,
...
...
cv/cp_cv/space.go
View file @
52253598
...
@@ -29,6 +29,7 @@ type CvCpLevel struct {
...
@@ -29,6 +29,7 @@ type CvCpLevel struct {
ExpireAtUnix
int64
`json:"expireAtUnix,omitempty"`
// 有效期,时间戳
ExpireAtUnix
int64
`json:"expireAtUnix,omitempty"`
// 有效期,时间戳
SettlementDate
string
`json:"settlementDate"`
// 等级过期时间
SettlementDate
string
`json:"settlementDate"`
// 等级过期时间
MaxLevel
cp_e
.
CpLevel
`json:"maxLevel"`
// cp最大的等级
MaxLevel
cp_e
.
CpLevel
`json:"maxLevel"`
// cp最大的等级
Title
string
`json:"title,omitempty"`
// 称号翻译
}
}
// 资源等级
// 资源等级
...
...
route/middleHandle.go
View file @
52253598
...
@@ -102,6 +102,12 @@ func LoggerHandle(c *gin.Context) {
...
@@ -102,6 +102,12 @@ func LoggerHandle(c *gin.Context) {
c
.
Set
(
mycontext
.
APP_VERSION
,
appVersion
)
c
.
Set
(
mycontext
.
APP_VERSION
,
appVersion
)
c
.
Set
(
mycontext
.
URL
,
reqUri
)
c
.
Set
(
mycontext
.
URL
,
reqUri
)
c
.
Set
(
mycontext
.
METHOD
,
method
)
c
.
Set
(
mycontext
.
METHOD
,
method
)
lang
:=
header
.
Get
(
mycontext
.
LANGUAGE
)
c
.
Set
(
mycontext
.
LANGUAGE
,
lang
)
carrier
:=
header
.
Get
(
mycontext
.
CARRIER
)
c
.
Set
(
mycontext
.
CARRIER
,
carrier
)
timezone
:=
header
.
Get
(
mycontext
.
TIMEZONE
)
c
.
Set
(
mycontext
.
TIMEZONE
,
timezone
)
userId
,
_
:=
req
.
GetUserId
(
c
)
userId
,
_
:=
req
.
GetUserId
(
c
)
...
...
route/user_r/inner.go
View file @
52253598
...
@@ -96,11 +96,13 @@ func GetUserBagId(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -96,11 +96,13 @@ func GetUserBagId(c *gin.Context) (*mycontext.MyContext, error) {
type
GetUserCpReq
struct
{
type
GetUserCpReq
struct
{
Id
mysql
.
ID
`form:"id" binding:"required"`
Id
mysql
.
ID
`form:"id" binding:"required"`
Language
string
`form:"language"`
}
}
// @Tags 用户-内部
// @Tags 用户-内部
// @Summary 获取用户cp
// @Summary 获取用户cp
// @Param id query int true "用户id"
// @Param id query int true "用户id"
// @Param language query string true "语言"
// @Success 200 {object} cp_cv.CvCp
// @Success 200 {object} cp_cv.CvCp
// @Router /inner/user/cp [get]
// @Router /inner/user/cp [get]
func
GetUserCp
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
func
GetUserCp
(
c
*
gin
.
Context
)
(
*
mycontext
.
MyContext
,
error
)
{
...
@@ -151,10 +153,16 @@ func GetUserCp(c *gin.Context) (*mycontext.MyContext, error) {
...
@@ -151,10 +153,16 @@ func GetUserCp(c *gin.Context) (*mycontext.MyContext, error) {
return
myContext
,
err
return
myContext
,
err
}
}
// 返回值
// 返回值
title
:=
""
if
msgId
,
ok
:=
cp_e
.
CpLevelTitle
[
level
.
Level
];
ok
{
title
=
cp_cv
.
GetTranslate
(
msgId
,
req
.
Language
)
}
response
=
cp_cv
.
CvCp
{
response
=
cp_cv
.
CvCp
{
CpUserInfo
:
userBases
[
cpUserId
],
CpUserInfo
:
userBases
[
cpUserId
],
CpLevel
:
cp_cv
.
CvCpLevel
{
CpLevel
:
cp_cv
.
CvCpLevel
{
Level
:
cpLevel
,
Level
:
cpLevel
,
Points
:
cp_e
.
CpLevelPoints
[
cpLevel
]
+
level
.
Points
,
Title
:
title
,
},
},
MyPrivilegeList
:
myPrivilegeList
,
MyPrivilegeList
:
myPrivilegeList
,
CpDays
:
int
(
time
.
Now
()
.
Sub
(
cpRelation
.
CreatedTime
)
.
Hours
()
/
24
)
+
1
,
CpDays
:
int
(
time
.
Now
()
.
Sub
(
cpRelation
.
CreatedTime
)
.
Hours
()
/
24
)
+
1
,
...
...
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