by Robin at 20240422

This commit is contained in:
Leufolium 2024-04-22 18:56:53 +08:00
parent bf1de24bcd
commit 50fa5e32b7
4 changed files with 26 additions and 11 deletions

View File

@ -1,8 +1,11 @@
package proto
import "service/dbstruct"
import (
accountproto "service/api/proto/account/proto"
"service/dbstruct"
)
type ZoneCollaboratorApiVO struct {
*dbstruct.ZoneCollaborator
*dbstruct.Account `json:"collaborator_account"`
Account *accountproto.ApiListOthersVO `json:"collaborator_account"`
}

View File

@ -1,8 +1,11 @@
package proto
import "service/dbstruct"
import (
accountproto "service/api/proto/account/proto"
"service/dbstruct"
)
type ZoneThirdPartnerApiVO struct {
*dbstruct.ZoneThirdPartner
*dbstruct.Account `json:"third_partner_account"`
Account *accountproto.ApiListOthersVO `json:"third_partner_account"`
}

View File

@ -69,6 +69,9 @@ func ApiGetZoneCollaboratorList(ctx *gin.Context) {
mediaFillableList[i] = media.Account.Avatar
}
mediafiller.FillList(ctx, mediaFillableList)
if ztpVO != nil && ztpVO.Account != nil && ztpVO.Account.Avatar != nil {
mediafiller.FillEntity(ctx, ztpVO.Account.Avatar)
}
data := &zone_collaborator_proto.ApiListData{
List: list,

View File

@ -2967,7 +2967,7 @@ func (s *Service) ApiGetZoneThirdPartnerList(ctx *gin.Context, req *zone_third_p
return
}
account, err := _DefaultAccount.OpListByMid(ctx, &accountproto.OpListByMidReq{
acct, err := _DefaultAccount.OpListByMid(ctx, &accountproto.OpListByMidReq{
Mid: zoneThirdPartner.ThirdPartnerMid,
})
if err != nil {
@ -2975,15 +2975,17 @@ func (s *Service) ApiGetZoneThirdPartnerList(ctx *gin.Context, req *zone_third_p
ec = errcode.ErrCodeAccountSrvFail
return
}
if account == nil {
if acct == nil {
logger.Error("No account entity was found, req: %v", util.ToJson(req))
ec = errcode.ErrCodeAccountNotExist
return
}
acctVO := &accountproto.ApiListOthersVO{}
acctVO.CopyAccount(acct)
vo = &zone_third_partner_proto.ZoneThirdPartnerApiVO{
ZoneThirdPartner: zoneThirdPartner,
Account: account,
Account: acctVO,
}
return
@ -3081,9 +3083,11 @@ func (s *Service) ApiGetZoneCollaboratorList(ctx *gin.Context, req *zone_collabo
for _, zone_collaborator := range list {
mid := zone_collaborator.GetCollaboratorMid()
acctVO := &accountproto.ApiListOthersVO{}
acctVO.CopyAccount(acctMp[mid])
vo := &zone_collaborator_proto.ZoneCollaboratorApiVO{
ZoneCollaborator: zone_collaborator,
Account: acctMp[mid],
Account: acctVO,
}
volist = append(volist, vo)
}
@ -3102,7 +3106,7 @@ func (s *Service) ApiGetZoneCollaboratorList(ctx *gin.Context, req *zone_collabo
return
}
account, err := _DefaultAccount.OpListByMid(ctx, &accountproto.OpListByMidReq{
acct, err := _DefaultAccount.OpListByMid(ctx, &accountproto.OpListByMidReq{
Mid: zoneThirdPartner.ThirdPartnerMid,
})
if err != nil {
@ -3110,15 +3114,17 @@ func (s *Service) ApiGetZoneCollaboratorList(ctx *gin.Context, req *zone_collabo
ec = errcode.ErrCodeAccountSrvFail
return
}
if account == nil {
if acct == nil {
logger.Error("No account entity was found, req: %v", util.ToJson(req))
ec = errcode.ErrCodeAccountNotExist
return
}
acctVO := &accountproto.ApiListOthersVO{}
acctVO.CopyAccount(acct)
ztpVO = &zone_third_partner_proto.ZoneThirdPartnerApiVO{
ZoneThirdPartner: zoneThirdPartner,
Account: account,
Account: acctVO,
}
return