Merge pull request 'by Robin at 20240427' (#359) from feat-IRONFANS-70 into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/359
This commit is contained in:
chenhao 2024-04-27 00:47:36 +08:00
commit 6376fc0d48
2 changed files with 21 additions and 10 deletions

View File

@ -2517,6 +2517,8 @@ func (s *Service) ApiUpdateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
return return
} }
zmStatus := zonemoment.GetStatus()
// 抹消审核信息,回退到初始 // 抹消审核信息,回退到初始
isReauditRequired := false isReauditRequired := false
if req.ZoneMoment.MediaComp != nil && req.ZoneMoment.GetMType() == consts.MediaTypeImg { if req.ZoneMoment.MediaComp != nil && req.ZoneMoment.GetMType() == consts.MediaTypeImg {
@ -2556,8 +2558,8 @@ func (s *Service) ApiUpdateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
return return
} }
// 回退空间内统计总数 // 回退空间内统计总数,只回退公开的情况
if isReauditRequired { if zmStatus == consts.ZoneMoment_Public && isReauditRequired {
mediaCountInc := len(zonemoment.MediaComp.GetImageIds()) mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
videoCountInc := len(zonemoment.MediaComp.GetVideoIds()) videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
err := _DefaultZone.RecordStatisticsById(ctx, zonemoment.GetZid(), -1, -int64(mediaCountInc), -int64(videoCountInc)) err := _DefaultZone.RecordStatisticsById(ctx, zonemoment.GetZid(), -1, -int64(mediaCountInc), -int64(videoCountInc))
@ -2645,7 +2647,8 @@ func (s *Service) ApiDeleteZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
} }
} }
// 回退空间内统计总数 // 回退空间内统计总数,只回退公开的情况
if zonemoment.GetStatus() == consts.ZoneMoment_Public {
mediaCountInc := len(zonemoment.MediaComp.GetImageIds()) mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
videoCountInc := len(zonemoment.MediaComp.GetVideoIds()) videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
err = _DefaultZone.RecordStatisticsById(ctx, zonemoment.GetZid(), -1, -int64(mediaCountInc), -int64(videoCountInc)) err = _DefaultZone.RecordStatisticsById(ctx, zonemoment.GetZid(), -1, -int64(mediaCountInc), -int64(videoCountInc))
@ -2654,6 +2657,7 @@ func (s *Service) ApiDeleteZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
ec = errcode.ErrCodeZoneSrvFail ec = errcode.ErrCodeZoneSrvFail
return return
} }
}
// 回退每日发帖次数 // 回退每日发帖次数
totalIncr := int64(-1) totalIncr := int64(-1)

View File

@ -87,3 +87,10 @@ func (p *ZoneMoment) GetUt() int64 {
} }
return 0 return 0
} }
func (p *ZoneMoment) GetStatus() int64 {
if p != nil && p.Status != nil {
return *p.Status
}
return 0
}