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
|
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,14 +2647,16 @@ func (s *Service) ApiDeleteZoneMoment(ctx *gin.Context, req *zonemomentproto.Api
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 回退空间内统计总数
|
// 回退空间内统计总数,只回退公开的情况
|
||||||
mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
|
if zonemoment.GetStatus() == consts.ZoneMoment_Public {
|
||||||
videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
|
mediaCountInc := len(zonemoment.MediaComp.GetImageIds())
|
||||||
err = _DefaultZone.RecordStatisticsById(ctx, zonemoment.GetZid(), -1, -int64(mediaCountInc), -int64(videoCountInc))
|
videoCountInc := len(zonemoment.MediaComp.GetVideoIds())
|
||||||
if err != nil {
|
err = _DefaultZone.RecordStatisticsById(ctx, zonemoment.GetZid(), -1, -int64(mediaCountInc), -int64(videoCountInc))
|
||||||
logger.Error("RecordStatisticsById fail, req: %v, err: %v", util.ToJson(req), err)
|
if err != nil {
|
||||||
ec = errcode.ErrCodeZoneSrvFail
|
logger.Error("RecordStatisticsById fail, req: %v, err: %v", util.ToJson(req), err)
|
||||||
return
|
ec = errcode.ErrCodeZoneSrvFail
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 回退每日发帖次数
|
// 回退每日发帖次数
|
||||||
|
|
|
@ -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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue