Merge remote-tracking branch 'origin/master'

# Conflicts:
#	test-test/src/main/java/com/test/test/domain/TestTask.java
#	test-test/src/main/java/com/test/test/mapper/TestTaskMapper.java
#	test-test/src/main/java/com/test/test/service/ITestTaskService.java
#	test-test/src/main/java/com/test/test/service/impl/TestTaskServiceImpl.java
#	test-test/src/main/resources/mapper/test/TestTaskMapper.xml
This commit is contained in:
liangdaliang
2025-02-21 15:18:01 +08:00
22 changed files with 2393 additions and 14 deletions

View File

@@ -4,7 +4,7 @@ import java.util.List;
import com.test.common.utils.DateUtils;
import com.test.test.domain.qo.IDQO;
import com.test.test.domain.qo.TestCaseListQO;
import com.test.test.domain.qo.GroupIdQO;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
@@ -33,7 +33,7 @@ public class TestCaseController extends BaseController {
* 查询用例列表
*/
@GetMapping("/list")
public TableDataInfo list(@Validated TestCaseListQO qo) {
public TableDataInfo list(@Validated GroupIdQO qo) {
startPage();
List<TestCase> list = testCaseService.selectTestCaseList(qo);
return getDataTable(list);

View File

@@ -0,0 +1,83 @@
package com.test.test.controller;
import java.util.List;
import com.test.common.utils.DateUtils;
import com.test.test.domain.qo.GroupIdQO;
import com.test.test.domain.qo.IDQO;
import jakarta.annotation.Resource;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.test.common.annotation.Log;
import com.test.common.core.controller.BaseController;
import com.test.common.core.domain.AjaxResult;
import com.test.common.enums.BusinessType;
import com.test.test.domain.TestTask;
import com.test.test.service.ITestTaskService;
import com.test.common.utils.poi.ExcelUtil;
import com.test.common.core.page.TableDataInfo;
/**
* 自动化测试Controller
*/
@RestController
@RequestMapping("/test/task")
public class TestTaskController extends BaseController {
@Resource
private ITestTaskService testTaskService;
/**
* 查询自动化测试列表
*/
@GetMapping("/list")
public TableDataInfo list(GroupIdQO qo) {
startPage();
List<TestTask> list = testTaskService.selectTestTaskList(qo);
return getDataTable(list);
}
/**
* 获取自动化测试详细信息
*/
@PostMapping(value = "/detail")
public AjaxResult getInfo(@RequestBody IDQO qo) {
return success(testTaskService.selectTestTaskById(qo.getId()));
}
/**
* 新增自动化测试
*/
@Log(title = "自动化测试", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody TestTask testTask) {
testTask.setCreateBy(getLoginUser().getUsername());
testTask.setCreateTime(DateUtils.getNowDate());
testTask.setStatus(0);
return toAjax(testTaskService.insertTestTask(testTask));
}
/**
* 修改自动化测试
*/
@Log(title = "自动化测试", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public AjaxResult edit(@RequestBody TestTask testTask) {
return toAjax(testTaskService.updateTestTask(testTask));
}
/**
* 删除自动化测试
*/
@Log(title = "自动化测试", businessType = BusinessType.DELETE)
@PostMapping("/del")
public AjaxResult remove(@RequestBody IDQO qo) {
return toAjax(testTaskService.deleteTestTaskById(qo.getId()));
}
}

View File

@@ -4,7 +4,7 @@ import jakarta.validation.constraints.NotNull;
import lombok.Data;
@Data
public class TestCaseListQO {
public class GroupIdQO {
@NotNull(message = "父节点id不能为空")
private Long groupId;
}

View File

@@ -1,7 +1,7 @@
package com.test.test.mapper;
import com.test.test.domain.TestCase;
import com.test.test.domain.qo.TestCaseListQO;
import com.test.test.domain.qo.GroupIdQO;
import java.util.List;
@@ -18,7 +18,7 @@ public interface TestCaseMapper
/**
* 查询用例列表
*/
List<TestCase> selectTestCaseList(TestCaseListQO qo);
List<TestCase> selectTestCaseList(GroupIdQO qo);
/**
* 新增用例

View File

@@ -1,7 +1,7 @@
package com.test.test.service;
import com.test.test.domain.TestCase;
import com.test.test.domain.qo.TestCaseListQO;
import com.test.test.domain.qo.GroupIdQO;
import java.util.List;
@@ -27,7 +27,7 @@ public interface ITestCaseService
* @param qo 用例
* @return 用例集合
*/
public List<TestCase> selectTestCaseList(TestCaseListQO qo);
public List<TestCase> selectTestCaseList(GroupIdQO qo);
/**
* 新增用例

View File

@@ -68,7 +68,7 @@ public class TestCaseServiceImpl implements ITestCaseService
* @return 用例
*/
@Override
public List<TestCase> selectTestCaseList(TestCaseListQO qo) {
public List<TestCase> selectTestCaseList(GroupIdQO qo) {
return testCaseMapper.selectTestCaseList(qo);
}

View File

@@ -33,7 +33,7 @@
from test_case
</sql>
<select id="selectTestCaseList" parameterType="TestCaseListQO" resultMap="TestCaseResult">
<select id="selectTestCaseList" parameterType="GroupIdQO" resultMap="TestCaseResult">
<include refid="selectTestCaseVo"/>
<where>
group_id = #{groupId}