Commit 25b34e4a authored by wdy's avatar wdy

每5秒调用第三方接口

parent 21db9e19
...@@ -21,7 +21,11 @@ public class TestRecords { ...@@ -21,7 +21,11 @@ public class TestRecords {
private Long id; private Long id;
@ApiModelProperty("关联项目id") @ApiModelProperty("关联项目id")
private String taskId; private String projectId;
@ApiModelProperty("关联任务id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long taskId;
@ApiModelProperty("用例名称") @ApiModelProperty("用例名称")
private String usecase; private String usecase;
......
...@@ -30,7 +30,7 @@ public class ScheduledTask implements Runnable{ ...@@ -30,7 +30,7 @@ public class ScheduledTask implements Runnable{
for (ModelTestTask testTask : modelList) { for (ModelTestTask testTask : modelList) {
if (testTask.getTestSchemeId() != null) { if (testTask.getTestSchemeId() != null) {
testRecordsService.sendPost(testTask.getTestSchemeId()); testRecordsService.sendPost(testTask.getTestSchemeId(),testTask.getId());
} }
} }
......
...@@ -18,5 +18,5 @@ public interface TestRecordsService extends IService<TestRecords> { ...@@ -18,5 +18,5 @@ public interface TestRecordsService extends IService<TestRecords> {
* 发送请求 * 发送请求
* @param id * @param id
*/ */
void sendPost(String id); void sendPost(String id,Long taskId);
} }
...@@ -28,7 +28,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -28,7 +28,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
@Override @Override
public void sendPost(String id) { public void sendPost(String id,Long taskId) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
map.put("id", id); map.put("id", id);
...@@ -66,7 +66,8 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR ...@@ -66,7 +66,8 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
if ((Objects.equals(caseResultVO.getStatus(), "PASSED") || Objects.equals(caseResultVO.getStatus(), "FAILED")) && !exists) { if ((Objects.equals(caseResultVO.getStatus(), "PASSED") || Objects.equals(caseResultVO.getStatus(), "FAILED")) && !exists) {
TestRecords testRecords = new TestRecords(); TestRecords testRecords = new TestRecords();
testRecords.setTaskId(projectId); testRecords.setProjectId(projectId);
testRecords.setTaskId(taskId);
testRecords.setUsecase(caseResultVO.getName()); testRecords.setUsecase(caseResultVO.getName());
testRecords.setUsecaseId(caseResultVO.getId()); testRecords.setUsecaseId(caseResultVO.getId());
testRecords.setDescription(caseResultVO.getDescription()); testRecords.setDescription(caseResultVO.getDescription());
......
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
<resultMap id="BaseResultMap" type="com.ruoyi.domain.TestRecords"> <resultMap id="BaseResultMap" type="com.ruoyi.domain.TestRecords">
<id property="id" column="id" jdbcType="BIGINT"/> <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="usecase" column="usecase" jdbcType="VARCHAR"/>
<result property="usecaseId" column="usecase_id" jdbcType="VARCHAR"/> <result property="usecaseId" column="usecase_id" jdbcType="VARCHAR"/>
<result property="testTime" column="test_time" jdbcType="TIMESTAMP"/> <result property="testTime" column="test_time" jdbcType="TIMESTAMP"/>
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
<result property="remediation" column="remediation" jdbcType="VARCHAR"/> <result property="remediation" column="remediation" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<select id="findByTaskId" resultType="com.ruoyi.domain.TestRecords"> <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 FROM t_test_records
WHERE task_id = #{id} WHERE task_id = #{id}
</select> </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