Merge pull request 'feat-20240117-001-Robin' (#145) from feat-20240117-001-Robin into test

Reviewed-on: http://121.41.31.146:3000/wishpal_ironfan/service/pulls/145
This commit is contained in:
chenhao 2024-02-27 19:19:22 +08:00
commit ac9f26eac3
2 changed files with 21 additions and 9 deletions

View File

@ -1612,17 +1612,23 @@ func (s *Service) ApiCreateMoment(ctx *gin.Context, req *momentproto.ApiCreateRe
// 封装动态审核任务
momentAuditTask := &dbstruct.MomentAuditTask{
AssociativeTableId: goproto.String(fmt.Sprint(util.DerefInt64(req.Moment.Id))),
ImageAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
TextAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
AuditedMedia: req.Moment.MediaComp,
AuditedText: req.Moment.Text,
AssociativeTableId: goproto.String(fmt.Sprint(util.DerefInt64(req.Moment.Id))),
//ImageAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
//TextAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
AuditedMedia: req.Moment.MediaComp,
AuditedText: req.Moment.Text,
}
if len(imageaudittasks) > 0 {
momentAuditTask.ImageAuditTaskId = imageaudittasks[0].Id
momentAuditTask.ImageAuditTaskStatus = goproto.Int64(consts.MomentAudit_Created)
} else {
momentAuditTask.ImageAuditTaskStatus = goproto.Int64(consts.MomentAudit_Passed)
}
if len(textaudittasks) > 0 {
momentAuditTask.TextAuditTaskId = textaudittasks[0].Id
momentAuditTask.TextAuditTaskStatus = goproto.Int64(consts.MomentAudit_Created)
} else {
momentAuditTask.TextAuditTaskStatus = goproto.Int64(consts.MomentAudit_Passed)
}
if err := _DefaultMomentAuditTask.OpCreate(ctx, &moment_audit_taskproto.OpCreateReq{
MomentAuditTask: momentAuditTask,
@ -1677,17 +1683,23 @@ func (s *Service) ApiUpdateMoment(ctx *gin.Context, req *momentproto.ApiUpdateRe
// 封装动态审核任务
momentAuditTask := &dbstruct.MomentAuditTask{
AssociativeTableId: goproto.String(fmt.Sprint(util.DerefInt64(req.Moment.Id))),
ImageAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
TextAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
AssociativeTableId: goproto.String(fmt.Sprint(util.DerefInt64(req.Moment.Id))),
//ImageAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
//TextAuditTaskStatus: goproto.Int64(consts.MomentAudit_Created),
}
if len(imageaudittasks) > 0 {
momentAuditTask.AuditedMedia = imageaudittasks[0].AuditedMedia
momentAuditTask.ImageAuditTaskId = imageaudittasks[0].Id
momentAuditTask.ImageAuditTaskStatus = goproto.Int64(consts.MomentAudit_Created)
} else {
momentAuditTask.ImageAuditTaskStatus = goproto.Int64(consts.MomentAudit_Passed)
}
if len(textaudittasks) > 0 {
momentAuditTask.AuditedText = textaudittasks[0].AuditedText
momentAuditTask.TextAuditTaskId = textaudittasks[0].Id
momentAuditTask.TextAuditTaskStatus = goproto.Int64(consts.MomentAudit_Created)
} else {
momentAuditTask.TextAuditTaskStatus = goproto.Int64(consts.MomentAudit_Passed)
}
if err := _DefaultMomentAuditTask.OpCreate(ctx, &moment_audit_taskproto.OpCreateReq{
MomentAuditTask: momentAuditTask,

View File

@ -61,7 +61,6 @@ func Run(batchId string) (successNum int, failNum int, err error) {
ConnectTimeout: tea.Int(30000),
}
_result, err := defaultImageAuditClient.ScanImageAdvance(req, runtime)
logger.Info("Receive the response from ScanImageAdvance: %v", _result.String())
if err != nil {
if _t, ok := err.(*tea.SDKError); ok {
logger.Error("ScanImageAdvance fail, errinfo : %v", util.DerefString(_t.Data))
@ -70,6 +69,7 @@ func Run(batchId string) (successNum int, failNum int, err error) {
failNum = len(imageaudittasks)
return
}
logger.Info("Receive the response from ScanImageAdvance: %v", _result.String())
// 4.处理应答
err = handleScanImageResponse(ctrlBlock, _result)