by Robin at 20240501

This commit is contained in:
Leufolium 2024-05-01 03:22:06 +08:00
parent d494eb921b
commit 6824e26e90
4 changed files with 75 additions and 11 deletions

View File

@ -0,0 +1,10 @@
package proto
import "service/library/validator"
func (p *ApiUpdateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
params = make([]*validator.JsonParam, 0)
params = append(params, validator.NewInt64PtrParam("请填写空间id", p.Zone.Id))
return
}

View File

@ -0,0 +1,10 @@
package proto
import "service/library/validator"
func (p *OpUpdateReq) ProvideNotNullValue() (params []*validator.JsonParam) {
params = make([]*validator.JsonParam, 0)
params = append(params, validator.NewInt64PtrParam("请填写空间表id", p.Zone.Id))
return
}

View File

@ -2,21 +2,23 @@ package proto
import (
streamerproto "service/api/proto/streamer/proto"
zone_collaborator_proto "service/api/proto/zone_collaborator/proto"
zone_third_partner_proto "service/api/proto/zone_third_partner/proto"
"service/bizcommon/util"
"service/dbstruct"
)
type OpZoneVO struct {
*dbstruct.Zone
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.OpListExtVO `json:"streamer_ext"` // 主播信息
ZoneThirdPartner *dbstruct.ZoneThirdPartner `json:"zone_third_partner"` // 代运营
ZoneCollaboratorList []*dbstruct.ZoneCollaborator `json:"zone_collaborator_list"` // 协作者
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.OpListExtVO `json:"streamer_ext"` // 主播信息
ZoneThirdPartner *zone_third_partner_proto.ZoneThirdPartnerApiVO `json:"zone_third_partner"` // 代运营
ZoneCollaboratorList []*zone_collaborator_proto.ZoneCollaboratorApiVO `json:"zone_collaborator_list"` // 协作者
}
func (vo *OpZoneVO) GetMid() int64 {

View File

@ -18,6 +18,8 @@ import (
textaudittaskproto "service/api/proto/textaudittask/proto"
thumbsupproto "service/api/proto/thumbsup/proto"
zoneproto "service/api/proto/zone/proto"
zone_collaborator_proto "service/api/proto/zone_collaborator/proto"
zone_third_partner_proto "service/api/proto/zone_third_partner/proto"
zonemomentproto "service/api/proto/zonemoment/proto"
zonemomentthumbsupproto "service/api/proto/zonemomentthumbsup/proto"
"service/apollostruct"
@ -1776,6 +1778,31 @@ func (s *Service) utilFillZonesWithOpVOInfo(ctx *gin.Context, list []*dbstruct.Z
return
}
// 5.获取账户信息
midSet = make(map[int64]*dbstruct.Zone)
mids = make([]int64, 0)
for _, ztp := range ztpMp {
mid := ztp.GetThirdPartnerMid()
if midSet[mid] == nil {
midSet[mid] = &dbstruct.Zone{}
mids = append(mids, mid)
}
}
for _, zclist := range zcMp {
for _, zc := range zclist {
mid := zc.GetCollaboratorMid()
if midSet[mid] == nil {
midSet[mid] = &dbstruct.Zone{}
mids = append(mids, mid)
}
}
}
acctMp, err := _DefaultAccount.GetAccountMapByMids(ctx, mids)
if err != nil {
logger.Error("GetAccountMapByMids fail, req: %v, err: %v", err)
return
}
// 8.获取空间付费信息
zvMap, _ := _DefaultVas.GetZoneVasByIds(ctx, zids)
@ -1788,10 +1815,25 @@ func (s *Service) utilFillZonesWithOpVOInfo(ctx *gin.Context, list []*dbstruct.Z
vo.CopyStreamerExt(streamerExtMap[vo.GetMid()])
// 填充代运营
vo.ZoneThirdPartner = ztpMp[zid]
ztp := ztpMp[zid]
ztpAcctVO := &accountproto.ApiListOthersVO{}
ztpAcctVO.CopyAccount(acctMp[ztp.GetThirdPartnerMid()])
vo.ZoneThirdPartner = &zone_third_partner_proto.ZoneThirdPartnerApiVO{
ZoneThirdPartner: ztp,
Account: ztpAcctVO,
}
// 填充协作者
vo.ZoneCollaboratorList = zcMp[zid]
zclist := zcMp[zid]
vo.ZoneCollaboratorList = make([]*zone_collaborator_proto.ZoneCollaboratorApiVO, 0)
for _, zc := range zclist {
zcAcctVO := &accountproto.ApiListOthersVO{}
zcAcctVO.CopyAccount(acctMp[zc.GetCollaboratorMid()])
vo.ZoneCollaboratorList = append(vo.ZoneCollaboratorList, &zone_collaborator_proto.ZoneCollaboratorApiVO{
ZoneCollaborator: zc,
Account: zcAcctVO,
})
}
if zv, ok := zvMap[zid]; ok {
vo.CopyZoneVas(zv)