This commit is contained in:
Leufolium 2024-07-02 19:57:28 +08:00
parent 0836a4baea
commit 561df91f82
2 changed files with 35 additions and 25 deletions

View File

@ -311,6 +311,30 @@ func (s *CronService) ClearContentAuditBatchExecutionLogs(ctx context.Context, p
return "clear content audit batch execution logs finished..."
}
// 每天0点定时清空图像和文字审核作业的日志
func (s *CronService) CreateVeriCode(ctx context.Context, param *xxl.RunReq) (msg string) {
logger.Info("task %v param: %v log_id: %v", param.ExecutorHandler, param.ExecutorParams, xxl.Int64ToStr(param.LogID))
mobilePhone := param.ExecutorParams
if mobilePhone == "" {
return "null mobile phone"
}
phoneHash := mycrypto.CryptoServiceInstance().SHA256.Encrypt([]byte(mobilePhone))
err := _DefaultVeriCode.OpCreate(&gin.Context{}, &vericodeproto.OpCreateReq{
VeriCode: &dbstruct.VeriCode{
PhoneHash: phoneHash,
VeriCode: "123456",
RegionCode: "86",
},
})
if err != nil {
return "create veri_code fail!"
}
return "verification code created: 123456"
}
// 每分钟查询反馈信息发送到钉钉机器人
func (s *CronService) SendContactCustomerServicesOfLastMinute(ctx context.Context, param *xxl.RunReq) (msg string) {
logger.Info("task %v param: %v log_id: %v", param.ExecutorHandler, param.ExecutorParams, xxl.Int64ToStr(param.LogID))
@ -347,30 +371,6 @@ func (s *CronService) SendContactCustomerServicesOfLastMinute(ctx context.Contex
return "Message send success"
}
// 每天0点定时清空图像和文字审核作业的日志
func (s *CronService) CreateVeriCode(ctx context.Context, param *xxl.RunReq) (msg string) {
logger.Info("task %v param: %v log_id: %v", param.ExecutorHandler, param.ExecutorParams, xxl.Int64ToStr(param.LogID))
mobilePhone := param.ExecutorParams
if mobilePhone == "" {
return "null mobile phone"
}
phoneHash := mycrypto.CryptoServiceInstance().SHA256.Encrypt([]byte(mobilePhone))
err := _DefaultVeriCode.OpCreate(&gin.Context{}, &vericodeproto.OpCreateReq{
VeriCode: &dbstruct.VeriCode{
PhoneHash: phoneHash,
VeriCode: "123456",
RegionCode: "86",
},
})
if err != nil {
return "create veri_code fail!"
}
return "verification code created: 123456"
}
// 每天0点对应当执行注销的账户执行注销操作
func (s *CronService) CancelAccountsAtDueTime(ctx context.Context, param *xxl.RunReq) (msg string) {
logger.Info("task %v param: %v log_id: %v", param.ExecutorHandler, param.ExecutorParams, xxl.Int64ToStr(param.LogID))
@ -552,6 +552,11 @@ func (s *CronService) VideoModerationBatch(ctx context.Context, param *xxl.RunRe
} else {
handleMsg.WriteString(fmt.Sprintf("batchId : %v, video moderation tasks of this batchId have finished, successNum: %v, failNum: %v", batchId, successNum, failNum))
}
// 同步视频审核结果
err = DefaultService.SyncVideoModerationTaskResultByBatchId(&gin.Context{}, batchId)
if err != nil {
handleMsg.WriteString(fmt.Sprintf("ERROR : batchId : %v, video moderation tasks of this batchId have failed to syncronize, err :%v", batchId, err))
}
logger.Info("Video moderation batch ends...")
return handleMsg.String()
@ -569,6 +574,11 @@ func (s *CronService) VideoModerationBatchHis(ctx context.Context, param *xxl.Ru
} else {
handleMsg.WriteString(fmt.Sprintf("batchId : %v, video moderation tasks of this batchId have finished, successNum: %v, failNum: %v", batchId, successNum, failNum))
}
// 同步视频审核结果
err = DefaultService.SyncVideoModerationTaskResultByBatchId(&gin.Context{}, batchId)
if err != nil {
handleMsg.WriteString(fmt.Sprintf("ERROR : batchId : %v, video moderation tasks of this batchId have failed to syncronize, err :%v", batchId, err))
}
logger.Info("Video moderation batch ends...")
return handleMsg.String()

View File

@ -168,7 +168,7 @@ func handleVideoModerationResponse(resp *green20220302.VideoModerationResponse,
}
if !isSuccess {
rErr := handleVideoModerationResultResponseBody(&green20220302.VideoModerationResultResponseBody{
_, _, rErr := handleVideoModerationResultResponseBody(&green20220302.VideoModerationResultResponseBody{
Code: goproto.Int32(code),
Message: goproto.String(msg),
Data: &green20220302.VideoModerationResultResponseBodyData{