Commit dc465373 authored by hujiebin's avatar hujiebin

feat

parent 70fb5d05
...@@ -18,6 +18,7 @@ type CvHeadwear struct { ...@@ -18,6 +18,7 @@ type CvHeadwear struct {
Using bool `json:"using"` Using bool `json:"using"`
PicUrl mysql.Str `json:"picUrl"` PicUrl mysql.Str `json:"picUrl"`
EffectUrl mysql.Str `json:"effectUrl"` EffectUrl mysql.Str `json:"effectUrl"`
ReverseEffectUrl mysql.Str `json:"reverseEffectUrl"`
TimeLeft int64 `json:"timeLeft"` // 离到期还有多少秒(过期则是负数) TimeLeft int64 `json:"timeLeft"` // 离到期还有多少秒(过期则是负数)
HeadwearIcon string `json:"headwearIcon"` HeadwearIcon string `json:"headwearIcon"`
} }
...@@ -64,6 +65,7 @@ func GetHeadwearList(db *gorm.DB, userId uint64) ([]CvHeadwear, error) { ...@@ -64,6 +65,7 @@ func GetHeadwearList(db *gorm.DB, userId uint64) ([]CvHeadwear, error) {
Id: i.HeadwearId, Id: i.HeadwearId,
PicUrl: resHwMap[i.HeadwearId].PicUrl, PicUrl: resHwMap[i.HeadwearId].PicUrl,
EffectUrl: resHwMap[i.HeadwearId].EffectUrl, EffectUrl: resHwMap[i.HeadwearId].EffectUrl,
ReverseEffectUrl: resHwMap[i.HeadwearId].ReverseEffectUrl,
Using: isUsing, Using: isUsing,
TimeLeft: i.EndTime.Unix() - now.Unix(), TimeLeft: i.EndTime.Unix() - now.Unix(),
}) })
...@@ -103,6 +105,7 @@ func GetCvHeadwear(userId uint64) (*CvHeadwear, error) { ...@@ -103,6 +105,7 @@ func GetCvHeadwear(userId uint64) (*CvHeadwear, error) {
Id: userHeadwear.HeadwearId, Id: userHeadwear.HeadwearId,
PicUrl: resHeadwear.PicUrl, PicUrl: resHeadwear.PicUrl,
EffectUrl: resHeadwear.EffectUrl, EffectUrl: resHeadwear.EffectUrl,
ReverseEffectUrl: resHeadwear.ReverseEffectUrl,
Using: userHeadwear.Using == headwear_e.YesUsing, Using: userHeadwear.Using == headwear_e.YesUsing,
}, nil }, nil
} }
...@@ -162,6 +165,7 @@ func BatchGetCvHeadwears(userIds []uint64) (map[uint64]CvHeadwear, error) { ...@@ -162,6 +165,7 @@ func BatchGetCvHeadwears(userIds []uint64) (map[uint64]CvHeadwear, error) {
Id: headwear.ID, Id: headwear.ID,
PicUrl: headwear.PicUrl, PicUrl: headwear.PicUrl,
EffectUrl: headwear.EffectUrl, EffectUrl: headwear.EffectUrl,
ReverseEffectUrl: headwear.ReverseEffectUrl,
Using: r.Using == headwear_e.YesUsing, Using: r.Using == headwear_e.YesUsing,
HeadwearIcon: response[r.UserId], HeadwearIcon: response[r.UserId],
} }
......
...@@ -13,6 +13,7 @@ type ResHeadwear struct { ...@@ -13,6 +13,7 @@ type ResHeadwear struct {
Name mysql.Str Name mysql.Str
PicUrl mysql.Str PicUrl mysql.Str
EffectUrl mysql.Str EffectUrl mysql.Str
ReverseEffectUrl mysql.Str
} }
//矛盾,项目负责人(产品不接受 商品 同上架分开两个数据结构的模式),又在页面上要求头饰同价格在一起展示,修改。 //矛盾,项目负责人(产品不接受 商品 同上架分开两个数据结构的模式),又在页面上要求头饰同价格在一起展示,修改。
......
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