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

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/317
This commit is contained in:
chenhao 2024-04-22 18:57:22 +08:00
commit 5a12f77380
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

@ -3013,7 +3013,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 {
@ -3021,15 +3021,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
@ -3133,9 +3135,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)
}
@ -3154,7 +3158,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 {
@ -3162,15 +3166,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