Merge pull request 'by Robin at 202240223; fix' (#132) from feat-20240117-001-Robin into test

Reviewed-on: #132
This commit is contained in:
chenhao 2024-02-23 17:22:38 +08:00
commit a03abd2073
2 changed files with 8 additions and 2 deletions

View File

@ -1611,13 +1611,13 @@ func (s *Service) ApiCreateMoment(ctx *gin.Context, req *momentproto.ApiCreateRe
AssociativeTableId: goproto.String(fmt.Sprint(util.DerefInt64(req.Moment.Id))), AssociativeTableId: goproto.String(fmt.Sprint(util.DerefInt64(req.Moment.Id))),
ImageAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created), ImageAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
TextAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created), TextAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
AuditedMedia: req.Moment.MediaComp,
AuditedText: req.Moment.Text,
} }
if len(imageaudittasks) > 0 { if len(imageaudittasks) > 0 {
momentAuditTask.AuditedMedia = imageaudittasks[0].AuditedMedia
momentAuditTask.ImageAuditTaskId = imageaudittasks[0].Id momentAuditTask.ImageAuditTaskId = imageaudittasks[0].Id
} }
if len(textaudittasks) > 0 { if len(textaudittasks) > 0 {
momentAuditTask.AuditedText = textaudittasks[0].AuditedText
momentAuditTask.TextAuditTaskId = textaudittasks[0].Id momentAuditTask.TextAuditTaskId = textaudittasks[0].Id
} }
if err := _DefaultMomentAuditTask.OpCreate(ctx, &moment_audit_taskproto.OpCreateReq{ if err := _DefaultMomentAuditTask.OpCreate(ctx, &moment_audit_taskproto.OpCreateReq{

View File

@ -454,6 +454,9 @@ func (s *Service) utilFillIsThumbedUpFillable(ctx *gin.Context, visitorMid int64
} }
func (s *Service) utilFillImageAuditTaskVO(ctx *gin.Context, vo *imageaudittaskproto.ImageAuditTaskVO) error { func (s *Service) utilFillImageAuditTaskVO(ctx *gin.Context, vo *imageaudittaskproto.ImageAuditTaskVO) error {
if vo == nil || vo.ImageAuditTask == nil {
return nil
}
task := vo.ImageAuditTask task := vo.ImageAuditTask
if util.DerefInt64(task.IsFragmented) == 1 { if util.DerefInt64(task.IsFragmented) == 1 {
imageaudits, err := _DefaultImageAudit.GetListByIds(ctx, util.DerefStringSlice(task.ImageAuditFragmentIds)) imageaudits, err := _DefaultImageAudit.GetListByIds(ctx, util.DerefStringSlice(task.ImageAuditFragmentIds))
@ -476,6 +479,9 @@ func (s *Service) utilFillImageAuditTaskVO(ctx *gin.Context, vo *imageaudittaskp
} }
func (s *Service) utilFillTextAuditTaskVO(ctx *gin.Context, vo *textaudittaskproto.TextAuditTaskVO) error { func (s *Service) utilFillTextAuditTaskVO(ctx *gin.Context, vo *textaudittaskproto.TextAuditTaskVO) error {
if vo == nil || vo.TextAuditTask == nil {
return nil
}
task := vo.TextAuditTask task := vo.TextAuditTask
textaudit, err := _DefaultTextAudit.OpList(ctx, &textauditproto.OpListReq{ textaudit, err := _DefaultTextAudit.OpList(ctx, &textauditproto.OpListReq{
Id: task.TextAuditId, Id: task.TextAuditId,