by Robin at 20240422

This commit is contained in:
Leufolium 2024-04-22 19:36:30 +08:00
parent 312c078216
commit 475132987d
1 changed files with 4 additions and 2 deletions

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
}