feat-IRONFANS-70 #320

Merged
chenhao merged 4 commits from feat-IRONFANS-70 into test 2024-04-22 19:37:08 +08:00
1 changed files with 4 additions and 2 deletions
Showing only changes of commit 475132987d - Show all commits

View File

@ -550,11 +550,13 @@ func (s *Service) ApiCreateZoneMomentBusinessValidate(ctx *gin.Context, req *zon
ec = errcode.ErrCodeMomentSrvOk
pType := int64(0)
mediaVisibleRange := int64(0)
switch req.ZoneMoment.GetCType() {
case consts.ZoneMomentCType_Free:
pType = consts.AccountPunishment_BlockFromCreatingFreeZoneMoment
case consts.ZoneMomentCType_Paid:
pType = consts.AccountPunishment_BlockFromCreatingPaidZoneMoment
mediaVisibleRange = req.ZoneMoment.GetMediaVisibleRange()
}
resultList := businessvalidator.NewAuthBusinessValidator(ctx, req).
@ -565,7 +567,7 @@ func (s *Service) ApiCreateZoneMomentBusinessValidate(ctx *gin.Context, req *zon
EnsureSuchAccountPunishmentNotExist(req.GetBaseRequest().Mid, pType, _DefaultAccountPunishment.OpListByMidAndType).
EnsureZoneMomentCreateTimesNotReachedDailyUpperbound(_DefaultZoneMomentCreateTimes.OpGetAndUpdate, req.GetBaseRequest().Mid).
EnsureAmongZoneMomentsPaidItemsLessThanFreeItems(_DefaultZoneMoment.OpCountByMidAndCType, req.GetBaseRequest().Mid, req.ZoneMoment.GetCType()).
EnsureZoneMomentImagesEnoughForEncryption(req.ZoneMoment.GetMType(), req.ZoneMoment.MediaComp, req.ZoneMoment.GetMediaVisibleRange()).
EnsureZoneMomentImagesEnoughForEncryption(req.ZoneMoment.GetMType(), req.ZoneMoment.MediaComp, mediaVisibleRange).
Validate().
Collect()
ec, _ = resultList[0].(errcode.ErrCode)
@ -634,7 +636,7 @@ func (s *Service) ApiCreateZoneCollaboratorBusinessValidate(ctx *gin.Context, re
ec = errcode.ErrCodeZoneCollaboratorWrongCollaborator
}
if ec != errcode.ErrCodeOk {
logger.Error("ApiGetAccountRelationCount business validation failed")
logger.Error("ApiCreateZoneCollaborator business validation failed")
return
}