diff --git a/test-test/src/main/java/com/test/test/controller/TestReportController.java b/test-test/src/main/java/com/test/test/controller/TestReportController.java index d219c9f..d787408 100644 --- a/test-test/src/main/java/com/test/test/controller/TestReportController.java +++ b/test-test/src/main/java/com/test/test/controller/TestReportController.java @@ -12,7 +12,7 @@ import com.test.test.service.ITestReportService; import java.util.List; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -37,7 +37,7 @@ public class TestReportController extends BaseController { * @return */ @PostMapping("/reportList") - public TableDataInfo list(@RequestBody IDQO qo) { + public TableDataInfo list(@Validated IDQO qo) { startPage(); List list = testReportService.selectTestReportList(qo.getId()); return getDataTable(list); diff --git a/test-test/src/main/java/com/test/test/domain/qo/IDQO.java b/test-test/src/main/java/com/test/test/domain/qo/IDQO.java index e45ab5b..6267391 100644 --- a/test-test/src/main/java/com/test/test/domain/qo/IDQO.java +++ b/test-test/src/main/java/com/test/test/domain/qo/IDQO.java @@ -3,6 +3,6 @@ package com.test.test.domain.qo; import lombok.Data; @Data -public class IDQO { +public class IDQO extends InheritQO{ private Long id; } diff --git a/test-test/src/main/java/com/test/test/domain/qo/InheritQO.java b/test-test/src/main/java/com/test/test/domain/qo/InheritQO.java new file mode 100644 index 0000000..dc5e958 --- /dev/null +++ b/test-test/src/main/java/com/test/test/domain/qo/InheritQO.java @@ -0,0 +1,14 @@ +package com.test.test.domain.qo; + +import java.io.Serializable; +import lombok.Data; + +@Data +public class InheritQO implements Serializable { + + private static final long serialVersionUID = -6405523005491017445L; + + private Integer pageNum; + + private Integer pageSize; +} diff --git a/test-test/src/main/resources/mapper/test/TestReportMapper.xml b/test-test/src/main/resources/mapper/test/TestReportMapper.xml index 8f2b8af..af09c4c 100644 --- a/test-test/src/main/resources/mapper/test/TestReportMapper.xml +++ b/test-test/src/main/resources/mapper/test/TestReportMapper.xml @@ -43,5 +43,6 @@ LEFT JOIN test_report tr ON tr.id = tpr.report_id WHERE tpr.plan_id = #{planId} AND tpr.del_flag = '0' + ORDER BY tr.create_time DESC \ No newline at end of file diff --git a/test-ui/src/api/test/testPlan.js b/test-ui/src/api/test/testPlan.js index 3c2fabe..72a2e70 100644 --- a/test-ui/src/api/test/testPlan.js +++ b/test-ui/src/api/test/testPlan.js @@ -67,10 +67,10 @@ export function addTestReport(data) { }) } -export function getTestReportList(id) { +export function getTestReportList(data) { return request({ url: api.getTestReportList, method: 'post', - data: {id} + params: data }) } diff --git a/test-ui/src/views/test/testplan/caseReport/caseReport.vue b/test-ui/src/views/test/testplan/caseReport/caseReport.vue index 6461251..fc02b25 100644 --- a/test-ui/src/views/test/testplan/caseReport/caseReport.vue +++ b/test-ui/src/views/test/testplan/caseReport/caseReport.vue @@ -91,7 +91,7 @@ export default { planId: '', }, queryParams: { - planId: '', + id: '', pageNum: 1, pageSize: 10, }, @@ -107,8 +107,8 @@ export default { methods: { getList() { this.loading = true - this.queryParams.planId = this.planId - getTestReportList(this.queryParams.planId).then(res => { + this.queryParams.id = Number(this.planId) + getTestReportList(this.queryParams).then(res => { this.list = res.rows this.total = res.total this.loading = false