新增工作流测试类
This commit is contained in:
parent
ac7340ca01
commit
b612421045
@ -1,10 +1,13 @@
|
||||
package com.example.easy.retry.controller;
|
||||
|
||||
import com.aizuda.easy.retry.server.model.dto.CallbackParamsDTO;
|
||||
import io.swagger.annotations.Api;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xiaowoniu
|
||||
* @date 2024-01-03 21:09:14
|
||||
@ -16,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
public class WorkflowCallbackController {
|
||||
|
||||
@PostMapping
|
||||
public void callback(@RequestBody Object object, @RequestHeader HttpHeaders headers) {
|
||||
public void callback(@RequestBody List<CallbackParamsDTO> object, @RequestHeader HttpHeaders headers) {
|
||||
log.info("callback: {}, secret:{} secret:{}", object, "secret", headers.getFirst("secret"));
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,7 @@ package com.example.easy.retry.job;
|
||||
|
||||
import com.aizuda.easy.retry.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.easy.retry.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.easy.retry.client.job.core.dto.JobContext;
|
||||
import com.aizuda.easy.retry.client.model.ExecuteResult;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,7 @@ package com.example.easy.retry.job;
|
||||
import com.aizuda.easy.retry.client.job.core.annotation.JobExecutor;
|
||||
import com.aizuda.easy.retry.client.job.core.dto.JobArgs;
|
||||
import com.aizuda.easy.retry.client.model.ExecuteResult;
|
||||
import com.aizuda.easy.retry.common.log.EasyRetryLog;
|
||||
import com.example.easy.retry.po.FailOrderPo;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@ -16,8 +17,10 @@ import org.springframework.stereotype.Component;
|
||||
public class TestWorkflowAnnoJobExecutor {
|
||||
|
||||
public ExecuteResult jobExecute(JobArgs jobArgs) {
|
||||
EasyRetryLog.REMOTE.info("任务执行开始. [{}]", jobArgs);
|
||||
FailOrderPo failOrderPo = new FailOrderPo();
|
||||
failOrderPo.setOrderId("xiaowoniu");
|
||||
EasyRetryLog.REMOTE.info("任务执行结束. [{}]", jobArgs);
|
||||
return ExecuteResult.success(failOrderPo);
|
||||
}
|
||||
|
||||
|
@ -78,11 +78,16 @@
|
||||
<appender-ref ref ="fileError"/>
|
||||
</appender>
|
||||
|
||||
<!-- EasyRetry appender -->
|
||||
<appender name="easyLogAppender" class="com.aizuda.easy.retry.client.common.appender.EasyRetryLogbackAppender">
|
||||
</appender>
|
||||
|
||||
<!-- 控制台输出日志级别 -->
|
||||
<root level="info">
|
||||
<appender-ref ref="stdout" />
|
||||
<appender-ref ref="asyncInfo" />
|
||||
<appender-ref ref="asyncWarn" />
|
||||
<appender-ref ref="asyncError" />
|
||||
<appender-ref ref="easyLogAppender" />
|
||||
</root>
|
||||
</configuration>
|
||||
|
Loading…
Reference in New Issue
Block a user