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
e40db93b
Commit
e40db93b
authored
Jun 12, 2023
by
chenweijian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cp
parent
bbcc739b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
12 deletions
+30
-12
bag.go
cv/user_cv/bag.go
+18
-10
bag.go
route/user_r/bag.go
+12
-2
No files found.
cv/user_cv/bag.go
View file @
e40db93b
...
...
@@ -5,14 +5,22 @@ import (
)
type
UserBag
struct
{
BagId
mysql
.
ID
`json:"bagId"`
// 背包id
ResType
mysql
.
Type
`json:"resType"`
// 道具类型 1:礼物道具
ResId
mysql
.
ID
`json:"resId"`
// 道具资源id
GiftId
mysql
.
ID
`json:"giftId"`
// 道具的礼物id
Name
string
`json:"name"`
// 资源名称
DiamondNum
mysql
.
Num
`json:"diamondNum"`
// 钻石数量
IconUrl
string
`json:"iconUrl"`
// icon url
SvgaUrl
string
`json:"svgaUrl"`
// svga url
Count
mysql
.
Num
`json:"count"`
// 拥有数量
RemainDays
int
`json:"remainDays"`
// 有效天数
BagId
mysql
.
ID
`json:"bagId"`
// 背包id
ResType
mysql
.
Type
`json:"resType"`
// 道具类型 1:礼物道具
ResId
mysql
.
ID
`json:"resId"`
// 道具资源id
GiftId
mysql
.
ID
`json:"giftId"`
// 道具的礼物id
Name
string
`json:"name"`
// 资源名称
DiamondNum
mysql
.
Num
`json:"diamondNum"`
// 钻石数量
IconUrl
string
`json:"iconUrl"`
// icon url
SvgaUrl
string
`json:"svgaUrl"`
// svga url
Count
mysql
.
Num
`json:"count"`
// 拥有数量
RemainDays
int
`json:"remainDays"`
// 有效天数
TextStyleList
[]
*
TextStyle
`json:"textStyleList"`
// 文本样式
}
type
TextStyle
struct
{
TextColor
string
`json:"textColor"`
//文本颜色
TextSize
float32
`json:"textSize"`
//文本字体大小
IsBold
bool
`json:"isBold"`
//是否加粗
TextKey
string
`json:"textKey"`
//替换svga 对象里面的key
}
route/user_r/bag.go
View file @
e40db93b
...
...
@@ -4,6 +4,7 @@ import (
"git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext"
"github.com/gin-gonic/gin"
"hilo-user/_const/enum/cp_e"
"hilo-user/_const/enum/res_e"
"hilo-user/cv/user_cv"
"hilo-user/domain/model/bag_m"
...
...
@@ -44,7 +45,7 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
}
for
_
,
bagGift
:=
range
userBagGifts
{
if
gift
,
ok
:=
allGifts
[
bagGift
.
ResId
];
ok
{
results
=
append
(
results
,
user_cv
.
UserBag
{
info
:=
user_cv
.
UserBag
{
BagId
:
bagGift
.
ID
,
ResType
:
res_e
.
ResUserBagGift
,
ResId
:
gift
.
ID
,
...
...
@@ -55,7 +56,16 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
SvgaUrl
:
gift
.
SvagUrl
,
Count
:
bagGift
.
Count
,
RemainDays
:
int
(
bagGift
.
EndTime
.
Sub
(
time
.
Now
())
.
Hours
()
/
24
),
})
}
if
gift
.
ID
==
cp_e
.
CpConfessionGiftId
{
// cwj---- 如果是cp告白礼物
info
.
TextStyleList
=
make
([]
*
user_cv
.
TextStyle
,
0
,
2
)
info
.
TextStyleList
=
append
(
info
.
TextStyleList
,
&
user_cv
.
TextStyle
{
TextColor
:
"#ce0083"
,
TextSize
:
20
,
TextKey
:
"sender_name"
},
&
user_cv
.
TextStyle
{
TextColor
:
"#ce0083"
,
TextSize
:
20
,
TextKey
:
"receiver_name"
},
)
}
results
=
append
(
results
,
info
)
}
}
default
:
...
...
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