Merge pull request 'feat-IRONFANS-70' (#297) from feat-IRONFANS-70 into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/297
This commit is contained in:
chenhao 2024-04-16 19:48:40 +08:00
commit 0d2fab9ed1
2 changed files with 32 additions and 8 deletions

View File

@ -8,13 +8,19 @@ import (
type ApiZoneVO struct {
*dbstruct.Zone
StreamerExt *streamerproto.ApiListExtVO `json:"streamer_ext"`
IsUnreadZoneMomentExist int64 `json:"is_unread_zone_moment_exist"`
VisitorRole int64 `json:"visitor_role"`
Previews *dbstruct.MediaComponent `json:"previews"`
Expenditure int64 `json:"expenditure"`
IsIronfanshipUnlocked int64 `json:"is_ironfanship_unlocked"`
IsSuperfanshipUnlocked int64 `json:"is_superfanship_unlocked"`
AdmissionPrice int64 `json:"admission_price" bson:"admission_price"` // 空间解锁价格, 单位: 分
IronfanshipPrice int64 `json:"ironfanship_price" bson:"ironfanship_price"` // 铁粉解锁价格, 单位: 分
IsSuperfanshipEnabled int `json:"is_superfanship_enabled" bson:"is_superfanship_enabled"` // 是否开启超粉空间 0: 关闭, 1: 开启
SuperfanshipPrice int64 `json:"superfanship_price" bson:"superfanship_price"` // 超粉价格, 单位: 分
SuperfanshipValidPeriod int `json:"superfanship_valid_period" bson:"superfanship_valid_period"` // 超粉有效期类型, SuperfanshipValidPeriod*
IsSuperfanshipGiveWechat int `json:"is_superfanship_give_wechat" bson:"is_superfanship_give_wechat"` // 是否开启超粉空间赠送微信 0: 不赠送, 1: 赠送
StreamerExt *streamerproto.ApiListExtVO `json:"streamer_ext"`
IsUnreadZoneMomentExist int64 `json:"is_unread_zone_moment_exist"`
VisitorRole int64 `json:"visitor_role"`
Previews *dbstruct.MediaComponent `json:"previews"`
Expenditure int64 `json:"expenditure"`
IsIronfanshipUnlocked int64 `json:"is_ironfanship_unlocked"`
IsSuperfanshipUnlocked int64 `json:"is_superfanship_unlocked"`
}
func (vo *ApiZoneVO) GetMid() int64 {
@ -45,3 +51,14 @@ func (vo *ApiZoneVO) SetIsIronfanshipUnlocked(is_ironfanship_unlocked int64) {
func (vo *ApiZoneVO) SetIsSuperfanshipUnlocked(is_superfanship_unlocked int64) {
vo.IsSuperfanshipUnlocked = is_superfanship_unlocked
}
func (vo *ApiZoneVO) CopyZoneVas(zv *dbstruct.ZoneVas) {
if zv != nil {
vo.AdmissionPrice = zv.AdmissionPrice
vo.IronfanshipPrice = zv.IronfanshipPrice
vo.IsSuperfanshipEnabled = zv.IsSuperfanshipEnabled
vo.SuperfanshipPrice = zv.SuperfanshipPrice
vo.SuperfanshipValidPeriod = zv.SuperfanshipValidPeriod
vo.IsSuperfanshipGiveWechat = zv.IsSuperfanshipGiveWechat
}
}

View File

@ -1515,7 +1515,10 @@ func (s *Service) utilFillZonesWithApiVOInfo(ctx *gin.Context, list []*dbstruct.
zoneZidMap[zone.GetId()] = zone
}
// 8.填充信息
// 8.获取空间付费信息
zvMap, _ := _DefaultVas.GetZoneVasByIds(ctx, zids)
// 9.填充信息
for _, vo := range volist {
zid := vo.Zone.GetId()
@ -1572,6 +1575,10 @@ func (s *Service) utilFillZonesWithApiVOInfo(ctx *gin.Context, list []*dbstruct.
} else {
vo.IsSuperfanshipUnlocked = consts.IsSuperfanshipUnlocked_No
}
if zv, ok := zvMap[zid]; ok {
vo.CopyZoneVas(zv)
}
}
return