diff --git a/test-test/src/main/java/com/test/test/controller/TestCaseStepController.java b/test-test/src/main/java/com/test/test/controller/TestCaseStepController.java new file mode 100644 index 0000000..38eb133 --- /dev/null +++ b/test-test/src/main/java/com/test/test/controller/TestCaseStepController.java @@ -0,0 +1,74 @@ +package com.test.test.controller; + +import com.test.common.annotation.Log; +import com.test.common.core.controller.BaseController; +import com.test.common.core.domain.AjaxResult; +import com.test.common.core.page.TableDataInfo; +import com.test.common.enums.BusinessType; +import com.test.common.utils.DateUtils; +import com.test.test.domain.TestCase; +import com.test.test.domain.TestCaseStep; +import com.test.test.domain.qo.IDQO; +import com.test.test.domain.qo.TestCaseListQO; +import com.test.test.service.ITestCaseService; +import com.test.test.service.ITestCaseStepService; +import jakarta.annotation.Resource; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 步骤Controller + */ +@RestController +@RequestMapping("/test/caseStep") +public class TestCaseStepController extends BaseController { + @Resource + private ITestCaseStepService testCaseStepService; + + /** + * 查询步骤列表 + */ + @GetMapping("/list") + public AjaxResult list(@Validated TestCaseStep qo) { + return success(testCaseStepService.selectTestCaseStepList(qo)); + } + + /** + * 获取步骤详细信息 + */ + @PostMapping(value = "/detail") + public AjaxResult getInfo(@RequestBody IDQO qo) { + return success(testCaseStepService.selectTestCaseStepById(qo.getId())); + } + + /** + * 新增步骤 + */ + @Log(title = "步骤", businessType = BusinessType.INSERT) + @PostMapping("/add") + public AjaxResult add(@RequestBody TestCaseStep testCaseStep) { + testCaseStep.setCreateBy(getLoginUser().getUsername()); + testCaseStep.setCreateTime(DateUtils.getNowDate()); + return toAjax(testCaseStepService.insertTestCaseStep(testCaseStep)); + } + + /** + * 修改步骤 + */ + @Log(title = "步骤", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + public AjaxResult edit(@RequestBody TestCaseStep testCaseStep) { + return toAjax(testCaseStepService.updateTestCaseStep(testCaseStep)); + } + + /** + * 删除步骤 + */ + @Log(title = "步骤", businessType = BusinessType.DELETE) + @PostMapping("/del") + public AjaxResult remove(@RequestBody IDQO qo) { + return toAjax(testCaseStepService.deleteTestCaseStepById(qo.getId())); + } +} diff --git a/test-test/src/main/resources/mapper/test/TestCaseStepMapper.xml b/test-test/src/main/resources/mapper/test/TestCaseStepMapper.xml index abdee99..cb305e7 100644 --- a/test-test/src/main/resources/mapper/test/TestCaseStepMapper.xml +++ b/test-test/src/main/resources/mapper/test/TestCaseStepMapper.xml @@ -56,8 +56,8 @@ datasource_id, sql_command, count, - async, - interval, + `async`, + `interval`, break_error, pre_script, post_script, diff --git a/test-ui/src/api/test/caseStep.js b/test-ui/src/api/test/caseStep.js new file mode 100644 index 0000000..53154bd --- /dev/null +++ b/test-ui/src/api/test/caseStep.js @@ -0,0 +1,46 @@ +import request from '@/utils/request' + +// 查询步骤列表 +export function listCaseStep(query) { + return request({ + url: '/test/caseStep/list', + method: 'get', + params: query + }) +} + +// 查询步骤详细 +export function getCaseStep(id) { + return request({ + url: '/test/caseStep/detail', + method: 'post', + data: {id} + }) +} + +// 新增步骤 +export function addCaseStep(data) { + return request({ + url: '/test/caseStep/add', + method: 'post', + data: data + }) +} + +// 修改步骤 +export function updateCaseStep(data) { + return request({ + url: '/test/caseStep/edit', + method: 'post', + data: data + }) +} + +// 删除步骤 +export function delCaseStep(id) { + return request({ + url: '/test/caseStep/del', + method: 'post', + data: {id} + }) +} diff --git a/test-ui/src/views/test/api/add.vue b/test-ui/src/views/test/api/add.vue index 69c4857..8cbb2b0 100644 --- a/test-ui/src/views/test/api/add.vue +++ b/test-ui/src/views/test/api/add.vue @@ -23,7 +23,7 @@ @@ -42,15 +42,12 @@ - - - @@ -89,7 +86,6 @@ export default { key: "", value: "", }], - contentType: "application/json", body: "", }, } @@ -139,8 +135,13 @@ export default { } } }, - handleDelete(scope) { - this.form.header.splice(scope.$index, 1) + handleDelete(flag, scope) { + if (flag === "header") { + this.form.header.splice(scope.$index, 1) + } + if (flag === "param") { + this.form.param.splice(scope.$index, 1) + } }, cancel() { this.$tab.closeOpenPage({path: "/api"}); diff --git a/test-ui/src/views/test/case/detail.vue b/test-ui/src/views/test/case/detail.vue deleted file mode 100644 index 5592e15..0000000 --- a/test-ui/src/views/test/case/detail.vue +++ /dev/null @@ -1,16 +0,0 @@ - - - - - diff --git a/test-ui/src/views/test/case/detail/index.vue b/test-ui/src/views/test/case/detail/index.vue new file mode 100644 index 0000000..53ac928 --- /dev/null +++ b/test-ui/src/views/test/case/detail/index.vue @@ -0,0 +1,66 @@ + + + + + diff --git a/test-ui/src/views/test/case/detail/page1.vue b/test-ui/src/views/test/case/detail/page1.vue new file mode 100644 index 0000000..51af85f --- /dev/null +++ b/test-ui/src/views/test/case/detail/page1.vue @@ -0,0 +1,327 @@ + + + + + diff --git a/test-ui/src/views/test/case/detail/page2.vue b/test-ui/src/views/test/case/detail/page2.vue new file mode 100644 index 0000000..fff7a18 --- /dev/null +++ b/test-ui/src/views/test/case/detail/page2.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/test-ui/src/views/test/case/detail/page3.vue b/test-ui/src/views/test/case/detail/page3.vue new file mode 100644 index 0000000..687ea07 --- /dev/null +++ b/test-ui/src/views/test/case/detail/page3.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/test-ui/src/views/test/case/detail/page4.vue b/test-ui/src/views/test/case/detail/page4.vue new file mode 100644 index 0000000..f67b226 --- /dev/null +++ b/test-ui/src/views/test/case/detail/page4.vue @@ -0,0 +1,13 @@ + + + + + diff --git a/test-ui/src/views/test/case/detail/step.vue b/test-ui/src/views/test/case/detail/step.vue new file mode 100644 index 0000000..afdea9e --- /dev/null +++ b/test-ui/src/views/test/case/detail/step.vue @@ -0,0 +1,101 @@ + + + + +