Commit 0e0fba37 authored by hujiebin's avatar hujiebin

feature/3.10

parent 40ccfdb2
...@@ -16,6 +16,7 @@ type UserBag struct { ...@@ -16,6 +16,7 @@ type UserBag struct {
Count mysql.Num `json:"count"` // 拥有数量 Count mysql.Num `json:"count"` // 拥有数量
RemainDays int `json:"remainDays"` // 有效天数 RemainDays int `json:"remainDays"` // 有效天数
TextStyleList []*TextStyle `json:"textStyleList"` // 文本样式 TextStyleList []*TextStyle `json:"textStyleList"` // 文本样式
HasGiftText bool `json:"hasGiftText"` // 是否有礼物文字
} }
type TextStyle struct { type TextStyle struct {
......
...@@ -22,6 +22,7 @@ type ResGift struct { ...@@ -22,6 +22,7 @@ type ResGift struct {
Together bool Together bool
Status mysql.UserYesNo Status mysql.UserYesNo
GiftType mysql.Type GiftType mysql.Type
HasGiftText bool
} }
// 获取所有的礼物 // 获取所有的礼物
......
...@@ -46,16 +46,17 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -46,16 +46,17 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
for _, bagGift := range userBagGifts { for _, bagGift := range userBagGifts {
if gift, ok := allGifts[bagGift.ResId]; ok { if gift, ok := allGifts[bagGift.ResId]; ok {
info := user_cv.UserBag{ info := user_cv.UserBag{
BagId: bagGift.ID, BagId: bagGift.ID,
ResType: res_e.ResUserBagGift, ResType: res_e.ResUserBagGift,
ResId: gift.ID, ResId: gift.ID,
GiftId: gift.ID, GiftId: gift.ID,
Name: gift.Name, Name: gift.Name,
DiamondNum: gift.DiamondNum, DiamondNum: gift.DiamondNum,
IconUrl: gift.IconUrl, IconUrl: gift.IconUrl,
SvgaUrl: gift.SvagUrl, SvgaUrl: gift.SvagUrl,
Count: bagGift.Count, Count: bagGift.Count,
RemainDays: int(bagGift.EndTime.Sub(time.Now()).Hours() / 24), RemainDays: int(bagGift.EndTime.Sub(time.Now()).Hours() / 24),
HasGiftText: gift.HasGiftText,
} }
if gift.ID == cp_e.CpConfessionGiftId { // 如果是cp告白礼物 if gift.ID == cp_e.CpConfessionGiftId { // 如果是cp告白礼物
info.TextStyleList = make([]*user_cv.TextStyle, 0, 2) info.TextStyleList = make([]*user_cv.TextStyle, 0, 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment