by Robin at 20240501
This commit is contained in:
parent
d494eb921b
commit
6824e26e90
|
@ -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
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -2,6 +2,8 @@ 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"
|
||||
)
|
||||
|
@ -15,8 +17,8 @@ type OpZoneVO struct {
|
|||
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"` // 协作者
|
||||
ZoneThirdPartner *zone_third_partner_proto.ZoneThirdPartnerApiVO `json:"zone_third_partner"` // 代运营
|
||||
ZoneCollaboratorList []*zone_collaborator_proto.ZoneCollaboratorApiVO `json:"zone_collaborator_list"` // 协作者
|
||||
}
|
||||
|
||||
func (vo *OpZoneVO) GetMid() int64 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue