Commit 92c818c2 authored by hujiebin's avatar hujiebin

feature/3.10

parent a078098c
......@@ -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 {
......
......@@ -22,6 +22,7 @@ type ResGift struct {
Together bool
Status mysql.UserYesNo
GiftType mysql.Type
HasGiftText bool
}
// 获取所有的礼物
......
......@@ -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)
......
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