Merge pull request 'feat-IRONFANS-242-Robin' (#822) from feat-IRONFANS-242-Robin into main

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/822
This commit is contained in:
chenhao 2024-11-21 17:51:38 +08:00
commit de55c9cb48
3 changed files with 3 additions and 1 deletions

View File

@ -717,6 +717,7 @@ func (s *Service) ApiCreateZoneThirdPartnerBusinessValidate(ctx *gin.Context, re
// 3.鉴权校验
resultList = businessvalidator.NewAuthBusinessValidator(ctx, req).
EnsureIsNotOperatingHisOwn(util.DerefInt64(req.ThirdPartnerMid)).
EnsureZoneThirdPartnerSharingRatioIsNotTooLarge(req.ZoneThirdPartner.GetSharingRatio()).
Validate().
Collect()
ec, _ = resultList[0].(errcode.ErrCode)

View File

@ -569,7 +569,7 @@ func (l *AuthBusinessValidator) EnsureZoneCollaboratorIsNotZoneOwner(fun func(ct
func (l *AuthBusinessValidator) EnsureZoneThirdPartnerSharingRatioIsNotTooLarge(sharingRatio float64) *AuthBusinessValidator {
l.oplist = append(l.oplist, func() {
if sharingRatio > 0.5 {
if sharingRatio > 0.5 || sharingRatio < 0 {
l.ec = errcode.ErrCodeZoneThirdPartnerSharingRatioTooLarge
return
}

View File

@ -1430,6 +1430,7 @@ func (s *Service) OpCreateZoneThirdPartnerBusinessValidate(ctx *gin.Context, req
// 1.鉴权校验
result := businessvalidator.NewAuthBusinessValidator(ctx, req).
EnsureZoneThirdPartnerIsNotZoneCreater(_DefaultZone.GetById, req.ZoneThirdPartner.GetZid(), req.ZoneThirdPartner.GetThirdPartnerMid()).
EnsureZoneThirdPartnerSharingRatioIsNotTooLarge(req.ZoneThirdPartner.GetSharingRatio()).
Validate().
Collect()
ec, _ = result[0].(errcode.ErrCode)