by Robin at 20240403
This commit is contained in:
parent
50f7e16608
commit
ed5d905eb7
|
@ -3973,7 +3973,7 @@ func (m *Mongo) ThumbsUpZoneMoment(ctx *gin.Context, req *zonemomentproto.OpZone
|
|||
func (m *Mongo) TryToCompleteZoneMomentAudit(ctx *gin.Context, zonemomentId int64) error {
|
||||
col := m.getColZoneMoment()
|
||||
set := qmgo.M{
|
||||
"status": consts.ZoneMoment_ManuallyReviewing,
|
||||
"status": int64(consts.ZoneMoment_ManuallyReviewing),
|
||||
"ut": time.Now().Unix(),
|
||||
}
|
||||
up := qmgo.M{
|
||||
|
@ -3991,6 +3991,10 @@ func (m *Mongo) TryToCompleteZoneMomentAudit(ctx *gin.Context, zonemomentId int6
|
|||
"del_flag": 0,
|
||||
}
|
||||
err := col.UpdateOne(ctx, filter, up)
|
||||
if err == qmgo.ErrNoSuchDocuments {
|
||||
err = nil
|
||||
return err
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -2084,6 +2084,7 @@ func (s *Service) ApiGetAccountCancellationListByMid(ctx *gin.Context, req *acco
|
|||
func (s *Service) ApiCreateZone(ctx *gin.Context, req *zoneproto.ApiCreateReq) (ec errcode.ErrCode) {
|
||||
ec = errcode.ErrCodeZoneSrvOk
|
||||
|
||||
req.Zone.Mid = goproto.Int64(req.GetBaseRequest().Mid)
|
||||
err := _DefaultZone.OpCreate(ctx, &zoneproto.OpCreateReq{
|
||||
Zone: req.Zone,
|
||||
})
|
||||
|
@ -2236,6 +2237,9 @@ func (s *Service) ApiGetZoneMomentListByVisitorMid(ctx *gin.Context, req *zonemo
|
|||
|
||||
// 1.查询访客关注的空间
|
||||
zids := make([]int64, 0)
|
||||
zids = append(zids, 1)
|
||||
zids = append(zids, 2)
|
||||
zids = append(zids, 3)
|
||||
|
||||
// 2.根据关注的zids查询得到这一轮的动态基底
|
||||
list, err := _DefaultZoneMoment.OpListByZids(ctx, &zonemomentproto.OpListByZidsReq{
|
||||
|
|
|
@ -557,7 +557,7 @@ func (s *Service) ApiCreateZoneMomentBusinessValidate(ctx *gin.Context, req *zon
|
|||
|
||||
resultList := businessvalidator.NewAuthBusinessValidator(ctx, req).
|
||||
EnsureSuchAccountPunishmentNotExist(req.GetBaseRequest().Mid, pType, _DefaultAccountPunishment.OpListByMidAndType).
|
||||
EnsureAmongZoneMomentsPaidItemsLessThanFreeItems(_DefaultZoneMoment.OpCountByMidAndCType, req.GetBaseRequest().Mid).
|
||||
EnsureAmongZoneMomentsPaidItemsLessThanFreeItems(_DefaultZoneMoment.OpCountByMidAndCType, req.GetBaseRequest().Mid, util.DerefInt64(req.CType)).
|
||||
Validate().
|
||||
Collect()
|
||||
ec, _ = resultList[0].(errcode.ErrCode)
|
||||
|
|
|
@ -299,9 +299,13 @@ func (l *AuthBusinessValidator) EnsureMomentCreateTimesNotReachedDailyUpperbound
|
|||
return l
|
||||
}
|
||||
|
||||
func (l *AuthBusinessValidator) EnsureAmongZoneMomentsPaidItemsLessThanFreeItems(fun func(*gin.Context, int64, int64) (int64, error), mid int64) *AuthBusinessValidator {
|
||||
func (l *AuthBusinessValidator) EnsureAmongZoneMomentsPaidItemsLessThanFreeItems(fun func(*gin.Context, int64, int64) (int64, error), mid int64, cType int64) *AuthBusinessValidator {
|
||||
l.oplist = append(l.oplist, func() {
|
||||
|
||||
if cType == consts.ZoneMomentCType_Free {
|
||||
return
|
||||
}
|
||||
|
||||
// 免费动态数
|
||||
freeCount, err1 := fun(l.ctx, mid, consts.ZoneMomentCType_Free)
|
||||
if err1 != nil {
|
||||
|
|
|
@ -159,6 +159,15 @@ func (handler *ImageAuditTaskResultHandler) generateZoneMomentMediaComponentUpda
|
|||
return func() error {
|
||||
//20240403更新: 增加成功后处理的切面,尝试触发完成审核的逻辑
|
||||
if option == consts.ImageAuditTaskUpdate_Success {
|
||||
err := _DefaultZoneMoment.OpUpdate(ctx, &zonemomentproto.OpUpdateReq{
|
||||
ZoneMoment: &dbstruct.ZoneMoment{
|
||||
Id: task.AssociativeTableId,
|
||||
ImageAuditStatus: goproto.Int64(consts.ImageAudit_Passed),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return _DefaultZoneMoment.TryToCompleteAudit(ctx, util.DerefInt64(task.AssociativeTableId))
|
||||
}
|
||||
|
||||
|
@ -169,9 +178,15 @@ func (handler *ImageAuditTaskResultHandler) generateZoneMomentMediaComponentUpda
|
|||
}
|
||||
}
|
||||
if len(notPassedImageIndexes) == 0 {
|
||||
return nil
|
||||
notPassedImageIndexes = append(notPassedImageIndexes, fmt.Sprint(0))
|
||||
}
|
||||
imageAuditOpinion := fmt.Sprintf("第%s张图片违规", strings.Join(notPassedImageIndexes, ", "))
|
||||
var imageAuditOpinion string
|
||||
if util.DerefInt64(task.Status) == consts.ImageAudit_ServiceFailed {
|
||||
imageAuditOpinion = "机审失败"
|
||||
} else {
|
||||
imageAuditOpinion = fmt.Sprintf("第%s张图片违规", strings.Join(notPassedImageIndexes, ", "))
|
||||
}
|
||||
|
||||
err := _DefaultZoneMoment.OpUpdate(ctx, &zonemomentproto.OpUpdateReq{
|
||||
ZoneMoment: &dbstruct.ZoneMoment{
|
||||
Id: task.AssociativeTableId,
|
||||
|
|
|
@ -173,15 +173,29 @@ func (handler *TextAuditTaskResultHandler) generateZoneMomentTextUpdateFunc() {
|
|||
return func() error {
|
||||
//20240403更新: 增加成功后处理的切面,尝试触发完成审核的逻辑
|
||||
if option == consts.TextAuditTaskUpdate_Success {
|
||||
err := _DefaultZoneMoment.OpUpdate(ctx, &zonemomentproto.OpUpdateReq{
|
||||
ZoneMoment: &dbstruct.ZoneMoment{
|
||||
Id: task.AssociativeTableId,
|
||||
TextAuditStatus: goproto.Int64(consts.TextAudit_Passed),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return _DefaultZoneMoment.TryToCompleteAudit(ctx, util.DerefInt64(task.AssociativeTableId))
|
||||
}
|
||||
|
||||
textAuditOpinion := fmt.Sprintf("文字违规")
|
||||
var textAuditOpinion string
|
||||
if util.DerefInt64(task.Status) == consts.TextAudit_ServiceFailed {
|
||||
textAuditOpinion = "机审失败"
|
||||
} else {
|
||||
textAuditOpinion = fmt.Sprintf("文字违规")
|
||||
}
|
||||
err := _DefaultZoneMoment.OpUpdate(ctx, &zonemomentproto.OpUpdateReq{
|
||||
ZoneMoment: &dbstruct.ZoneMoment{
|
||||
Id: task.AssociativeTableId,
|
||||
ImageAuditStatus: task.Status,
|
||||
ImageAuditOpinion: goproto.String(textAuditOpinion),
|
||||
Id: task.AssociativeTableId,
|
||||
TextAuditStatus: task.Status,
|
||||
TextAuditOpinion: goproto.String(textAuditOpinion),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue