diff --git a/cv/user_cv/bag.go b/cv/user_cv/bag.go index e33a6385d1cc0e7fc818a7743d2d99a009d9ecf0..42033151f33ea75da6d6ccd44ecbc6aa128c943e 100644 --- a/cv/user_cv/bag.go +++ b/cv/user_cv/bag.go @@ -16,6 +16,7 @@ type UserBag struct { Count mysql.Num `json:"count"` // 拥有数量 RemainDays int `json:"remainDays"` // 有效天数 TextStyleList []*TextStyle `json:"textStyleList"` // 文本样式 + HasGiftText bool `json:"hasGiftText"` // 是否有礼物文字 } type TextStyle struct { diff --git a/domain/model/res_m/gift.go b/domain/model/res_m/gift.go index 79f1776dd0cee90c5ceced2d44bbbc8fc62f12c8..78bc0f8e4201aa28fc9d4722ce58e7e3ec964bd4 100644 --- a/domain/model/res_m/gift.go +++ b/domain/model/res_m/gift.go @@ -22,6 +22,7 @@ type ResGift struct { Together bool Status mysql.UserYesNo GiftType mysql.Type + HasGiftText bool } // 获取所有的礼物 diff --git a/route/user_r/bag.go b/route/user_r/bag.go index 3d83b3395bcbb6165f0066b6409d6ac626d958c1..18a38bac9e2207ab3165a5c552d6567128f43082 100644 --- a/route/user_r/bag.go +++ b/route/user_r/bag.go @@ -46,16 +46,17 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) { for _, bagGift := range userBagGifts { if gift, ok := allGifts[bagGift.ResId]; ok { info := user_cv.UserBag{ - 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), + 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), + HasGiftText: gift.HasGiftText, } if gift.ID == cp_e.CpConfessionGiftId { // 如果是cp告白礼物 info.TextStyleList = make([]*user_cv.TextStyle, 0, 2)