by Robin at 20240422
This commit is contained in:
parent
d762f5df3a
commit
ab8db00368
|
@ -2,6 +2,7 @@ package proto
|
|||
|
||||
import (
|
||||
"service/api/base"
|
||||
zone_third_partner_proto "service/api/proto/zone_third_partner/proto"
|
||||
"service/dbstruct"
|
||||
)
|
||||
|
||||
|
@ -57,10 +58,10 @@ type ApiListReq struct {
|
|||
}
|
||||
|
||||
type ApiListData struct {
|
||||
List []*ZoneCollaboratorApiVO `json:"list"`
|
||||
ZoneThirdPartner *dbstruct.ZoneThirdPartner `json:"zone_third_partner"`
|
||||
Offset int `json:"offset"`
|
||||
More int `json:"more"`
|
||||
List []*ZoneCollaboratorApiVO `json:"list"`
|
||||
ZoneThirdPartnerVO *zone_third_partner_proto.ZoneThirdPartnerApiVO `json:"zone_third_partner"`
|
||||
Offset int `json:"offset"`
|
||||
More int `json:"more"`
|
||||
}
|
||||
|
||||
type ApiListResp struct {
|
||||
|
|
|
@ -17,7 +17,7 @@ func ApiCreateZoneCollaborator(ctx *gin.Context) {
|
|||
ec := service.DefaultService.ApiCreateZoneCollaborator(ctx, req)
|
||||
if ec != errcode.ErrCodeZoneCollaboratorSrvOk {
|
||||
logger.Error("ApiCreateZoneCollaborator fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrorMsg(ctx, "server error")
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -56,7 +56,7 @@ func ApiGetZoneCollaboratorList(ctx *gin.Context) {
|
|||
req.Limit = consts.DefaultPageSize
|
||||
}
|
||||
|
||||
list, zoneThirdPartner, ec := service.DefaultService.ApiGetZoneCollaboratorList(ctx, req)
|
||||
list, ztpVO, ec := service.DefaultService.ApiGetZoneCollaboratorList(ctx, req)
|
||||
if ec != errcode.ErrCodeZoneCollaboratorSrvOk {
|
||||
logger.Error("ApiGetZoneCollaboratorList fail, req: %v, ec: %v", util.ToJson(req), ec)
|
||||
ReplyErrCodeMsg(ctx, ec)
|
||||
|
@ -71,9 +71,9 @@ func ApiGetZoneCollaboratorList(ctx *gin.Context) {
|
|||
mediafiller.FillList(ctx, mediaFillableList)
|
||||
|
||||
data := &zone_collaborator_proto.ApiListData{
|
||||
List: list,
|
||||
ZoneThirdPartner: zoneThirdPartner,
|
||||
Offset: req.Offset + len(list),
|
||||
List: list,
|
||||
ZoneThirdPartnerVO: ztpVO,
|
||||
Offset: req.Offset + len(list),
|
||||
}
|
||||
if len(list) >= req.Limit {
|
||||
data.More = 1
|
||||
|
|
|
@ -3034,7 +3034,7 @@ func (s *Service) ApiDeleteZoneCollaborator(ctx *gin.Context, id int64) (ec errc
|
|||
return
|
||||
}
|
||||
|
||||
func (s *Service) ApiGetZoneCollaboratorList(ctx *gin.Context, req *zone_collaborator_proto.ApiListReq) (volist []*zone_collaborator_proto.ZoneCollaboratorApiVO, zoneThirdPartner *dbstruct.ZoneThirdPartner, ec errcode.ErrCode) {
|
||||
func (s *Service) ApiGetZoneCollaboratorList(ctx *gin.Context, req *zone_collaborator_proto.ApiListReq) (volist []*zone_collaborator_proto.ZoneCollaboratorApiVO, ztpVO *zone_third_partner_proto.ZoneThirdPartnerApiVO, ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeZoneCollaboratorSrvOk
|
||||
|
||||
// 查询协作者表
|
||||
|
@ -3080,12 +3080,36 @@ func (s *Service) ApiGetZoneCollaboratorList(ctx *gin.Context, req *zone_collabo
|
|||
}
|
||||
|
||||
// 查询代运营信息
|
||||
zoneThirdPartner, err = _DefaultZoneThirdPartner.GetZoneThirdPartnerByZid(ctx, util.DerefInt64(req.Zid))
|
||||
zoneThirdPartner, err := _DefaultZoneThirdPartner.GetZoneThirdPartnerByZid(ctx, util.DerefInt64(req.Zid))
|
||||
if err != nil {
|
||||
logger.Error("_DefaultZoneThirdPartner GetZoneThirdPartnerByZid fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeZoneThirdPartnerSrvFail
|
||||
return
|
||||
}
|
||||
if zoneThirdPartner == nil {
|
||||
logger.Error("No zone third partner was found, req: %v", util.ToJson(req))
|
||||
ec = errcode.ErrCodeZoneThirdPartnerNotExist
|
||||
return
|
||||
}
|
||||
|
||||
account, err := _DefaultAccount.OpListByMid(ctx, &accountproto.OpListByMidReq{
|
||||
Mid: zoneThirdPartner.ThirdPartnerMid,
|
||||
})
|
||||
if err != nil {
|
||||
logger.Error("_DefaultAccount OpListByMid fail, req: %v, err: %v", util.ToJson(req), err)
|
||||
ec = errcode.ErrCodeAccountSrvFail
|
||||
return
|
||||
}
|
||||
if account == nil {
|
||||
logger.Error("No account entity was found, req: %v", util.ToJson(req))
|
||||
ec = errcode.ErrCodeAccountNotExist
|
||||
return
|
||||
}
|
||||
|
||||
ztpVO = &zone_third_partner_proto.ZoneThirdPartnerApiVO{
|
||||
ZoneThirdPartner: zoneThirdPartner,
|
||||
Account: account,
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue