Commit 25b34e4a authored by wdy's avatar wdy

每5秒调用第三方接口

parent 21db9e19
......@@ -21,7 +21,11 @@ public class TestRecords {
private Long id;
@ApiModelProperty("关联项目id")
private String taskId;
private String projectId;
@ApiModelProperty("关联任务id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long taskId;
@ApiModelProperty("用例名称")
private String usecase;
......
......@@ -30,7 +30,7 @@ public class ScheduledTask implements Runnable{
for (ModelTestTask testTask : modelList) {
if (testTask.getTestSchemeId() != null) {
testRecordsService.sendPost(testTask.getTestSchemeId());
testRecordsService.sendPost(testTask.getTestSchemeId(),testTask.getId());
}
}
......
......@@ -18,5 +18,5 @@ public interface TestRecordsService extends IService<TestRecords> {
* 发送请求
* @param id
*/
void sendPost(String id);
void sendPost(String id,Long taskId);
}
......@@ -28,7 +28,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
@Override
public void sendPost(String id) {
public void sendPost(String id,Long taskId) {
Map<String, Object> map = new HashMap<>();
map.put("id", id);
......@@ -66,7 +66,8 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if ((Objects.equals(caseResultVO.getStatus(), "PASSED") || Objects.equals(caseResultVO.getStatus(), "FAILED")) && !exists) {
TestRecords testRecords = new TestRecords();
testRecords.setTaskId(projectId);
testRecords.setProjectId(projectId);
testRecords.setTaskId(taskId);
testRecords.setUsecase(caseResultVO.getName());
testRecords.setUsecaseId(caseResultVO.getId());
testRecords.setDescription(caseResultVO.getDescription());
......
......@@ -6,7 +6,8 @@
<resultMap id="BaseResultMap" type="com.ruoyi.domain.TestRecords">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="taskId" column="task_id" jdbcType="VARCHAR"/>
<result property="projectId" column="project_id" jdbcType="VARCHAR"/>
<result property="taskId" column="task_id" jdbcType="BIGINT"/>
<result property="usecase" column="usecase" jdbcType="VARCHAR"/>
<result property="usecaseId" column="usecase_id" jdbcType="VARCHAR"/>
<result property="testTime" column="test_time" jdbcType="TIMESTAMP"/>
......@@ -17,7 +18,7 @@
<result property="remediation" column="remediation" jdbcType="VARCHAR"/>
</resultMap>
<select id="findByTaskId" resultType="com.ruoyi.domain.TestRecords">
SELECT id, task_id, usecase, usecase_id, test_time, description, risk_level, test_method, test_result, remediation
SELECT id, project_id, task_id, usecase, usecase_id, test_time, description, risk_level, test_method, test_result, remediation
FROM t_test_records
WHERE task_id = #{id}
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment