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
aaa2c006
Commit
aaa2c006
authored
Feb 21, 2023
by
hujiebin
2
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:调整结构体
parent
2c0cbe8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
18 deletions
+90
-18
enum.go
_const/enum/gift_e/enum.go
+59
-0
bag.go
cv/user_cv/bag.go
+16
-9
bag.go
route/user_r/bag.go
+15
-9
No files found.
_const/enum/gift_e/enum.go
0 → 100644
View file @
aaa2c006
package
gift_e
import
"git.hilo.cn/hilo-common/resource/mysql"
type
GiftOperateSceneType
mysql
.
Type
const
(
//匹配声网中场景
MatchVedioSceneType
GiftOperateSceneType
=
1
// 私聊
PriveChatSceneType
GiftOperateSceneType
=
2
//1对1视频
VideoSceneType
GiftOperateSceneType
=
3
//群组
GroupSceneType
GiftOperateSceneType
=
4
)
type
ResGiftAvatarType
=
mysql
.
Type
const
(
SendGiftCpGiftAvatarType
ResGiftAvatarType
=
1
//周CP
MonthlyWealthGiftAvatarType
ResGiftAvatarType
=
2
//月冠财富榜
MonthlyCharmGiftAvatarType
ResGiftAvatarType
=
3
//月冠魅力榜
MonthlyPayGiftAvatarType
ResGiftAvatarType
=
4
//月冠充值榜
WeekStarGiftAvatarType
ResGiftAvatarType
=
5
//周星榜
CountryStarGiftAvatarType
ResGiftAvatarType
=
6
// 国家之星
)
type
GiftPrivateRecordType
=
mysql
.
Type
const
(
PrivateRecord
GiftPrivateRecordType
=
1
VideoTradeUnion
GiftPrivateRecordType
=
2
)
type
GiftColumnType
=
uint16
const
(
GiftColumnGift
GiftColumnType
=
1
// 礼物
GiftColumnRomance
GiftColumnType
=
2
// 浪漫
GiftColumnCountry
GiftColumnType
=
3
// 国家
GiftColumnCustom
GiftColumnType
=
4
// 定制
)
type
GiftTagType
=
uint16
const
(
GiftTagMedal
GiftTagType
=
1
// 勋章礼物
GiftTagWeeklyStar
GiftTagType
=
2
// 周星礼物
)
type
GiftEntryType
=
uint16
const
(
GiftEntryWeeklyStar
GiftEntryType
=
1
// 周星活动入口
GiftEntryWeeklyCp
GiftEntryType
=
2
// 周CP活动入口
GiftEntryMedal
GiftEntryType
=
3
// 勋章激活动入口
GiftEntryCountryStar
GiftEntryType
=
4
// 国家之星活动入口
)
cv/user_cv/bag.go
View file @
aaa2c006
...
...
@@ -2,16 +2,23 @@ package user_cv
import
(
"git.hilo.cn/hilo-common/resource/mysql"
"hilo-user/_const/enum/gift_e"
)
type
UserBag
struct
{
BagId
mysql
.
ID
`json:"bagId"`
// 背包id
ResType
mysql
.
Type
`json:"resType"`
// 道具类型 1:礼物道具
ResId
mysql
.
ID
`json:"resId"`
// 道具资源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"`
// 有效天数
Tags
[]
gift_e
.
GiftTagType
`json:"tags"`
// 角标
ShowEntry
bool
`json:"showEntry"`
// 是否显示快捷入口
GroupBroadcast
bool
`json:"group_broadcast"`
// 是否群组群发
SenderAvatar
string
`json:"senderAvatar"`
// key:sender_avatar
ReceiverAvatar
string
`json:"receiverAvatar"`
// key:receiver_avatar
}
route/user_r/bag.go
View file @
aaa2c006
...
...
@@ -31,6 +31,8 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
if
err
!=
nil
{
return
myCtx
,
err
}
//weeklyStarGifts, _ := activity_m.GetWeeklyStartGift(model)
//medalGifts, _ := res_m.FindMedalPublicObtainAll(model.Db)
var
results
[]
user_cv
.
UserBag
switch
res_e
.
ResUserBag
(
resType
)
{
case
res_e
.
ResUserBagGift
:
...
...
@@ -45,15 +47,19 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
for
_
,
bagGift
:=
range
userBagGifts
{
if
gift
,
ok
:=
allValidGifts
[
bagGift
.
ResId
];
ok
{
results
=
append
(
results
,
user_cv
.
UserBag
{
BagId
:
bagGift
.
ID
,
ResType
:
res_e
.
ResUserBagGift
,
ResId
:
gift
.
ID
,
Name
:
gift
.
Name
,
DiamondNum
:
gift
.
DiamondNum
,
IconUrl
:
gift
.
IconUrl
,
SvgaUrl
:
gift
.
SvagUrl
,
Count
:
bagGift
.
Count
,
RemainDays
:
int
(
bagGift
.
EndTime
.
Sub
(
time
.
Now
())
.
Hours
()
/
24
),
BagId
:
bagGift
.
ID
,
ResType
:
res_e
.
ResUserBagGift
,
ResId
:
gift
.
ID
,
GiftId
:
gift
.
ID
,
Name
:
gift
.
Name
,
DiamondNum
:
gift
.
DiamondNum
,
IconUrl
:
gift
.
IconUrl
,
SvgaUrl
:
gift
.
SvagUrl
,
Count
:
bagGift
.
Count
,
RemainDays
:
int
(
bagGift
.
EndTime
.
Sub
(
time
.
Now
())
.
Hours
()
/
24
),
Tags
:
nil
,
// todo
ShowEntry
:
false
,
// todo
GroupBroadcast
:
gift
.
GroupBroadcast
,
})
}
}
...
...
hujiebin
@hujiebin
mentioned in commit
9dee630a
·
Feb 21, 2023
mentioned in commit
9dee630a
mentioned in commit 9dee630a9ecd6f5a212ff6145e3461ce79b04edb
Toggle commit list
hujiebin
@hujiebin
mentioned in commit
1c33ff36
·
Mar 01, 2023
mentioned in commit
1c33ff36
mentioned in commit 1c33ff36151f182582961080e0f84acc152cebd7
Toggle commit list
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