by Robin at 20240515

This commit is contained in:
Leufolium 2024-05-15 16:19:31 +08:00
parent c12b1e1164
commit f11b170914
1 changed files with 17 additions and 0 deletions

View File

@ -3742,12 +3742,29 @@ func (s *Service) OpSetPrivateZoneMoment(ctx *gin.Context, req *zonemomentproto.
// ZoneThirdPartner
func (s *Service) OpCreateZoneThirdPartner(ctx *gin.Context, req *zone_third_partner_proto.OpCreateReq) (ec errcode.ErrCode) {
ec = errcode.ErrCodeZoneThirdPartnerSrvOk
err := _DefaultZoneThirdPartner.OpCreate(ctx, req)
if err != nil {
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneThirdPartnerSrvFail
return
}
if mongo.IsDuplicateKeyError(err) {
logger.Error("OpCreate duplicate key found, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneThirdPartnerDuplicateKey
return
}
if err != nil {
logger.Error("OpCreate fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneThirdPartnerSrvFail
return
}
_err := _DefaultVas.ZoneFreeJoinThirdPartner(ctx, req.ZoneThirdPartner.GetThirdPartnerMid(), req.ZoneThirdPartner.GetZid())
if _err != nil {
logger.Error("ZoneFreeJoinThirdPartner fail, mid: %v, zid: %v, err: %v", req.ZoneThirdPartner.GetThirdPartnerMid(), req.ZoneThirdPartner.GetZid(), _err)
}
return
}