by Robin at 20240427

This commit is contained in:
Leufolium 2024-04-27 00:39:28 +08:00
parent 9fed951998
commit 9a5968f158
1 changed files with 10 additions and 0 deletions

View File

@ -2645,6 +2645,16 @@ func (s *Service) ApiDeleteZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
}
}
// 回退空间内统计总数
mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
err = _DefaultZone.RecordStatisticsById(ctx, zonemoment.GetZid(), -1, -int64(mediaCountInc), -int64(videoCountInc))
if err != nil {
logger.Error("RecordStatisticsById fail, req: %v, err: %v", util.ToJson(req), err)
ec = errcode.ErrCodeZoneSrvFail
return
}
// 回退每日发帖次数
totalIncr := int64(-1)
_, err = _DefaultZoneMomentCreateTimes.OpGetAndUpdate(ctx, zone.GetMid(), totalIncr)