by Robin at 20240422
This commit is contained in:
parent
312c078216
commit
475132987d
|
@ -550,11 +550,13 @@ func (s *Service) ApiCreateZoneMomentBusinessValidate(ctx *gin.Context, req *zon
|
||||||
ec = errcode.ErrCodeMomentSrvOk
|
ec = errcode.ErrCodeMomentSrvOk
|
||||||
|
|
||||||
pType := int64(0)
|
pType := int64(0)
|
||||||
|
mediaVisibleRange := int64(0)
|
||||||
switch req.ZoneMoment.GetCType() {
|
switch req.ZoneMoment.GetCType() {
|
||||||
case consts.ZoneMomentCType_Free:
|
case consts.ZoneMomentCType_Free:
|
||||||
pType = consts.AccountPunishment_BlockFromCreatingFreeZoneMoment
|
pType = consts.AccountPunishment_BlockFromCreatingFreeZoneMoment
|
||||||
case consts.ZoneMomentCType_Paid:
|
case consts.ZoneMomentCType_Paid:
|
||||||
pType = consts.AccountPunishment_BlockFromCreatingPaidZoneMoment
|
pType = consts.AccountPunishment_BlockFromCreatingPaidZoneMoment
|
||||||
|
mediaVisibleRange = req.ZoneMoment.GetMediaVisibleRange()
|
||||||
}
|
}
|
||||||
|
|
||||||
resultList := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
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).
|
EnsureSuchAccountPunishmentNotExist(req.GetBaseRequest().Mid, pType, _DefaultAccountPunishment.OpListByMidAndType).
|
||||||
EnsureZoneMomentCreateTimesNotReachedDailyUpperbound(_DefaultZoneMomentCreateTimes.OpGetAndUpdate, req.GetBaseRequest().Mid).
|
EnsureZoneMomentCreateTimesNotReachedDailyUpperbound(_DefaultZoneMomentCreateTimes.OpGetAndUpdate, req.GetBaseRequest().Mid).
|
||||||
EnsureAmongZoneMomentsPaidItemsLessThanFreeItems(_DefaultZoneMoment.OpCountByMidAndCType, req.GetBaseRequest().Mid, req.ZoneMoment.GetCType()).
|
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().
|
Validate().
|
||||||
Collect()
|
Collect()
|
||||||
ec, _ = resultList[0].(errcode.ErrCode)
|
ec, _ = resultList[0].(errcode.ErrCode)
|
||||||
|
@ -634,7 +636,7 @@ func (s *Service) ApiCreateZoneCollaboratorBusinessValidate(ctx *gin.Context, re
|
||||||
ec = errcode.ErrCodeZoneCollaboratorWrongCollaborator
|
ec = errcode.ErrCodeZoneCollaboratorWrongCollaborator
|
||||||
}
|
}
|
||||||
if ec != errcode.ErrCodeOk {
|
if ec != errcode.ErrCodeOk {
|
||||||
logger.Error("ApiGetAccountRelationCount business validation failed")
|
logger.Error("ApiCreateZoneCollaborator business validation failed")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue