From 99116d4f31f2af6f7a3aa853b02c7cad22a5cd1e Mon Sep 17 00:00:00 2001 From: Leufolium Date: Thu, 11 Apr 2024 20:58:26 +0800 Subject: [PATCH] by Robin at 20240411 --- app/mix/service/apiservice.go | 7 +++++++ app/mix/service/service.go | 2 ++ 2 files changed, 9 insertions(+) diff --git a/app/mix/service/apiservice.go b/app/mix/service/apiservice.go index 8cb4bda7..b35de175 100644 --- a/app/mix/service/apiservice.go +++ b/app/mix/service/apiservice.go @@ -2248,11 +2248,14 @@ func (s *Service) ApiCreateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api req.ZoneMoment.Status = goproto.Int64(consts.ZoneMoment_Auditing) // 默认正在审核中 if req.ZoneMoment.MediaComp != nil && len(req.ZoneMoment.MediaComp.GetImageIds()) > 0 { req.ZoneMoment.ImageAuditStatus = goproto.Int64(consts.ImageAudit_Created) // 创建 + req.ZoneMoment.MediaAmount = goproto.Int64(int64(len(req.ZoneMoment.MediaComp.GetImageIds()))) } else { req.ZoneMoment.ImageAuditStatus = goproto.Int64(consts.ImageAudit_Passed) // 视频贴默认已通过 + req.ZoneMoment.MediaAmount = goproto.Int64(int64(len(req.ZoneMoment.MediaComp.GetVideoIds()))) } req.ZoneMoment.TextAuditStatus = goproto.Int64(consts.TextAudit_Created) // 创建 req.ZoneMoment.ManuallyReviewStatus = goproto.Int64(consts.ZoneMomentManuallyReview_Waiting) // 等待复审 + err := _DefaultZoneMoment.OpCreate(ctx, &zonemomentproto.OpCreateReq{ BaseRequest: req.BaseRequest, ZoneMoment: req.ZoneMoment, @@ -2292,6 +2295,10 @@ func (s *Service) ApiUpdateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api isReauditRequired = true req.ZoneMoment.ImageAuditStatus = goproto.Int64(consts.ImageAudit_Created) // 创建 req.ZoneMoment.ImageAuditOpinion = goproto.String("") // 信息抹除 + req.ZoneMoment.MediaAmount = goproto.Int64(int64(len(req.ZoneMoment.MediaComp.GetImageIds()))) + } + if req.ZoneMoment.MediaComp != nil && util.DerefInt64(req.ZoneMoment.MType) == consts.MediaTypeVideo { + req.ZoneMoment.MediaAmount = goproto.Int64(int64(len(req.ZoneMoment.MediaComp.GetVideoIds()))) } if req.ZoneMoment.Text != nil { isReauditRequired = true diff --git a/app/mix/service/service.go b/app/mix/service/service.go index 8453af4f..ea7467ed 100644 --- a/app/mix/service/service.go +++ b/app/mix/service/service.go @@ -3197,8 +3197,10 @@ func (s *Service) OpCreateZoneMoment(ctx *gin.Context, req *zonemomentproto.OpCr req.ZoneMoment.Status = goproto.Int64(consts.ZoneMoment_Auditing) // 默认正在审核中 if req.ZoneMoment.MediaComp != nil && len(req.ZoneMoment.MediaComp.GetImageIds()) > 0 { req.ZoneMoment.ImageAuditStatus = goproto.Int64(consts.ImageAudit_Created) // 创建 + req.ZoneMoment.MediaAmount = goproto.Int64(int64(len(req.ZoneMoment.MediaComp.GetImageIds()))) } else { req.ZoneMoment.ImageAuditStatus = goproto.Int64(consts.ImageAudit_Passed) // 视频贴默认已通过 + req.ZoneMoment.MediaAmount = goproto.Int64(int64(len(req.ZoneMoment.MediaComp.GetVideoIds()))) } req.ZoneMoment.TextAuditStatus = goproto.Int64(consts.TextAudit_Created) // 创建 req.ZoneMoment.ManuallyReviewStatus = goproto.Int64(consts.ZoneMomentManuallyReview_Waiting) // 等待复审