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:
commit
6376fc0d48
|
@ -2517,6 +2517,8 @@ func (s *Service) ApiUpdateZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
|
|||
return
|
||||
}
|
||||
|
||||
zmStatus := zonemoment.GetStatus()
|
||||
|
||||
// 抹消审核信息,回退到初始
|
||||
isReauditRequired := false
|
||||
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
|
||||
}
|
||||
|
||||
// 回退空间内统计总数
|
||||
if isReauditRequired {
|
||||
// 回退空间内统计总数,只回退公开的情况
|
||||
if zmStatus == consts.ZoneMoment_Public && isReauditRequired {
|
||||
mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
|
||||
videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
|
||||
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())
|
||||
videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
|
||||
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
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
// 回退每日发帖次数
|
||||
totalIncr := int64(-1)
|
||||
|
|
|
@ -87,3 +87,10 @@ func (p *ZoneMoment) GetUt() int64 {
|
|||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (p *ZoneMoment) GetStatus() int64 {
|
||||
if p != nil && p.Status != nil {
|
||||
return *p.Status
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue