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:
commit
ac9f26eac3
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue