Commit e40db93b authored by chenweijian's avatar chenweijian

cp

parent bbcc739b
...@@ -15,4 +15,12 @@ type UserBag struct { ...@@ -15,4 +15,12 @@ type UserBag struct {
SvgaUrl string `json:"svgaUrl"` // svga url SvgaUrl string `json:"svgaUrl"` // svga url
Count mysql.Num `json:"count"` // 拥有数量 Count mysql.Num `json:"count"` // 拥有数量
RemainDays int `json:"remainDays"` // 有效天数 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
} }
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"git.hilo.cn/hilo-common/domain" "git.hilo.cn/hilo-common/domain"
"git.hilo.cn/hilo-common/mycontext" "git.hilo.cn/hilo-common/mycontext"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"hilo-user/_const/enum/cp_e"
"hilo-user/_const/enum/res_e" "hilo-user/_const/enum/res_e"
"hilo-user/cv/user_cv" "hilo-user/cv/user_cv"
"hilo-user/domain/model/bag_m" "hilo-user/domain/model/bag_m"
...@@ -44,7 +45,7 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -44,7 +45,7 @@ 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 {
results = append(results, 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,
...@@ -55,7 +56,16 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -55,7 +56,16 @@ func UserBag(c *gin.Context) (*mycontext.MyContext, error) {
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),
}) }
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: default:
......
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