http server资源增删改查
This commit is contained in:
@@ -11,8 +11,6 @@ import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/test/group")
|
||||
public class TestGroupController extends BaseController {
|
||||
@@ -24,8 +22,7 @@ public class TestGroupController extends BaseController {
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list(String type) {
|
||||
List<TestGroup> list = testGroupService.selectTestGroupList(type);
|
||||
return success(list);
|
||||
return success(testGroupService.selectTestGroupList(type));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.test.test.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.test.test.domain.qo.IDQO;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
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.TestHttp;
|
||||
import com.test.test.service.ITestHttpService;
|
||||
import com.test.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* http服务Controller
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/test/http")
|
||||
public class TestHttpController extends BaseController {
|
||||
@Resource
|
||||
private ITestHttpService testHttpService;
|
||||
|
||||
/**
|
||||
* 查询http服务列表
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
public AjaxResult list() {
|
||||
return success(testHttpService.selectTestHttpList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取http服务详细信息
|
||||
*/
|
||||
@PostMapping(value = "/detail")
|
||||
public AjaxResult getInfo(@RequestBody IDQO qo) {
|
||||
return success(testHttpService.selectTestHttpById(qo.getId()));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增http服务
|
||||
*/
|
||||
@Log(title = "http服务", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
public AjaxResult add(@RequestBody TestHttp testHttp) {
|
||||
return success(testHttpService.insertTestHttp(testHttp));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改http服务
|
||||
*/
|
||||
@Log(title = "http服务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody TestHttp testHttp) {
|
||||
return toAjax(testHttpService.updateTestHttp(testHttp));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除http服务
|
||||
*/
|
||||
@Log(title = "http服务", businessType = BusinessType.DELETE)
|
||||
@PostMapping("/del")
|
||||
public AjaxResult remove(@RequestBody IDQO qo) {
|
||||
return toAjax(testHttpService.deleteTestHttpById(qo.getId()));
|
||||
}
|
||||
}
|
||||
58
test-test/src/main/java/com/test/test/domain/TestHttp.java
Normal file
58
test-test/src/main/java/com/test/test/domain/TestHttp.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package com.test.test.domain;
|
||||
|
||||
import com.test.common.annotation.Excel;
|
||||
import com.test.common.core.domain.BaseEntity;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.ToString;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@ToString
|
||||
public class TestHttp extends BaseEntity {
|
||||
/**
|
||||
* 服务id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 服务名
|
||||
*/
|
||||
@Excel(name = "服务名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 协议(http, https)
|
||||
*/
|
||||
@Excel(name = "协议(http, https)")
|
||||
private String protocol;
|
||||
|
||||
/**
|
||||
* 主机
|
||||
*/
|
||||
@Excel(name = "主机")
|
||||
private String host;
|
||||
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
@Excel(name = "端口")
|
||||
private String port;
|
||||
|
||||
/**
|
||||
* 前置路径
|
||||
*/
|
||||
@Excel(name = "前置路径")
|
||||
private String basePath;
|
||||
|
||||
/**
|
||||
* 请求头
|
||||
*/
|
||||
@Excel(name = "请求头")
|
||||
private String header;
|
||||
|
||||
/**
|
||||
* 删除标志(0代表存在 2代表删除)
|
||||
*/
|
||||
private String delFlag;
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.test.test.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.test.test.domain.TestHttp;
|
||||
|
||||
/**
|
||||
* http服务Mapper接口
|
||||
*/
|
||||
public interface TestHttpMapper {
|
||||
/**
|
||||
* 查询http服务
|
||||
*/
|
||||
TestHttp selectTestHttpById(Long id);
|
||||
|
||||
/**
|
||||
* 查询http服务列表
|
||||
*/
|
||||
List<TestHttp> selectTestHttpList();
|
||||
|
||||
/**
|
||||
* 新增http服务
|
||||
*/
|
||||
int insertTestHttp(TestHttp testHttp);
|
||||
|
||||
/**
|
||||
* 修改http服务
|
||||
*/
|
||||
int updateTestHttp(TestHttp testHttp);
|
||||
|
||||
/**
|
||||
* 删除http服务
|
||||
*/
|
||||
int deleteTestHttpById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除http服务
|
||||
*/
|
||||
int deleteTestHttpByIds(Long[] ids);
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.test.test.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.test.test.domain.TestHttp;
|
||||
|
||||
/**
|
||||
* http服务Service接口
|
||||
*/
|
||||
public interface ITestHttpService {
|
||||
/**
|
||||
* 查询http服务
|
||||
*/
|
||||
TestHttp selectTestHttpById(Long id);
|
||||
|
||||
/**
|
||||
* 查询http服务列表
|
||||
*/
|
||||
List<TestHttp> selectTestHttpList();
|
||||
|
||||
/**
|
||||
* 新增http服务
|
||||
*/
|
||||
TestHttp insertTestHttp(TestHttp testHttp);
|
||||
|
||||
/**
|
||||
* 修改http服务
|
||||
*/
|
||||
int updateTestHttp(TestHttp testHttp);
|
||||
|
||||
/**
|
||||
* 批量删除http服务
|
||||
*/
|
||||
int deleteTestHttpByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除http服务信息
|
||||
*/
|
||||
int deleteTestHttpById(Long id);
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.test.test.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.test.common.utils.DateUtils;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.test.test.mapper.TestHttpMapper;
|
||||
import com.test.test.domain.TestHttp;
|
||||
import com.test.test.service.ITestHttpService;
|
||||
|
||||
/**
|
||||
* http服务Service业务层处理
|
||||
*/
|
||||
@Service
|
||||
public class TestHttpServiceImpl implements ITestHttpService {
|
||||
@Resource
|
||||
private TestHttpMapper testHttpMapper;
|
||||
|
||||
/**
|
||||
* 查询http服务
|
||||
*/
|
||||
@Override
|
||||
public TestHttp selectTestHttpById(Long id) {
|
||||
return testHttpMapper.selectTestHttpById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询http服务列表
|
||||
*/
|
||||
@Override
|
||||
public List<TestHttp> selectTestHttpList() {
|
||||
return testHttpMapper.selectTestHttpList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增http服务
|
||||
*/
|
||||
@Override
|
||||
public TestHttp insertTestHttp(TestHttp testHttp) {
|
||||
testHttp.setCreateTime(DateUtils.getNowDate());
|
||||
testHttpMapper.insertTestHttp(testHttp);
|
||||
return testHttp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改http服务
|
||||
*/
|
||||
@Override
|
||||
public int updateTestHttp(TestHttp testHttp) {
|
||||
testHttp.setUpdateTime(DateUtils.getNowDate());
|
||||
return testHttpMapper.updateTestHttp(testHttp);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除http服务
|
||||
*/
|
||||
@Override
|
||||
public int deleteTestHttpByIds(Long[] ids) {
|
||||
return testHttpMapper.deleteTestHttpByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除http服务信息
|
||||
*/
|
||||
@Override
|
||||
public int deleteTestHttpById(Long id) {
|
||||
return testHttpMapper.deleteTestHttpById(id);
|
||||
}
|
||||
}
|
||||
@@ -28,10 +28,10 @@
|
||||
<select id="selectTestApiList" parameterType="TestApiListQO" resultMap="TestApiResult">
|
||||
<include refid="selectTestApiVo"/>
|
||||
<where>
|
||||
<if test="groupId != null "> and group_id = #{groupId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="method != null and method != ''"> and method = #{method}</if>
|
||||
<if test="uri != null and uri != ''"> and uri like concat('%', #{uri}, '%')</if>
|
||||
<if test="groupId != null ">and group_id = #{groupId}</if>
|
||||
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
||||
<if test="method != null and method != ''">and method = #{method}</if>
|
||||
<if test="uri != null and uri != ''">and uri like concat('%', #{uri}, '%')</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.test.test.mapper.TestCaseLogMapper">
|
||||
|
||||
<resultMap type="TestCaseLog" id="TestCaseLogResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="caseId" column="case_id" />
|
||||
<result property="operType" column="oper_type" />
|
||||
<result property="operDetail" column="oper_detail" />
|
||||
<result property="operUser" column="oper_user" />
|
||||
<result property="operTime" column="oper_time" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="caseId" column="case_id"/>
|
||||
<result property="operType" column="oper_type"/>
|
||||
<result property="operDetail" column="oper_detail"/>
|
||||
<result property="operUser" column="oper_user"/>
|
||||
<result property="operTime" column="oper_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTestCaseLogVo">
|
||||
select id, case_id, oper_type, oper_detail, oper_user, oper_time from test_case_log
|
||||
select id, case_id, oper_type, oper_detail, oper_user, oper_time
|
||||
from test_case_log
|
||||
</sql>
|
||||
|
||||
<select id="selectTestCaseLogList" parameterType="TestCaseLog" resultMap="TestCaseLogResult">
|
||||
<include refid="selectTestCaseLogVo"/>
|
||||
<where>
|
||||
<if test="caseId != null and caseId != ''"> and case_id = #{caseId}</if>
|
||||
<if test="operType != null and operType != ''"> and oper_type = #{operType}</if>
|
||||
<if test="operDetail != null and operDetail != ''"> and oper_detail = #{operDetail}</if>
|
||||
<if test="operUser != null "> and oper_user = #{operUser}</if>
|
||||
<if test="operTime != null "> and oper_time = #{operTime}</if>
|
||||
<if test="caseId != null and caseId != ''">and case_id = #{caseId}</if>
|
||||
<if test="operType != null and operType != ''">and oper_type = #{operType}</if>
|
||||
<if test="operDetail != null and operDetail != ''">and oper_detail = #{operDetail}</if>
|
||||
<if test="operUser != null ">and oper_user = #{operUser}</if>
|
||||
<if test="operTime != null ">and oper_time = #{operTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -41,14 +42,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="operDetail != null">oper_detail,</if>
|
||||
<if test="operUser != null">oper_user,</if>
|
||||
<if test="operTime != null">oper_time,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="caseId != null">#{caseId},</if>
|
||||
<if test="operType != null">#{operType},</if>
|
||||
<if test="operDetail != null">#{operDetail},</if>
|
||||
<if test="operUser != null">#{operUser},</if>
|
||||
<if test="operTime != null">#{operTime},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTestCaseLog" parameterType="TestCaseLog">
|
||||
@@ -64,7 +65,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteTestCaseLogById" parameterType="Long">
|
||||
delete from test_case_log where id = #{id}
|
||||
delete
|
||||
from test_case_log
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTestCaseLogByIds" parameterType="String">
|
||||
|
||||
@@ -1,35 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.test.test.mapper.TestCaseMapper">
|
||||
|
||||
<resultMap type="TestCase" id="TestCaseResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupId" column="group_id" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="importance" column="importance" />
|
||||
<result property="status" column="status" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="groupId" column="group_id"/>
|
||||
<result property="projectId" column="project_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="importance" column="importance"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTestCaseVo">
|
||||
select id, group_id, project_id, name, importance, status, del_flag, create_by, create_time, update_by, update_time from test_case
|
||||
select id,
|
||||
group_id,
|
||||
project_id,
|
||||
name,
|
||||
importance,
|
||||
status,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from test_case
|
||||
</sql>
|
||||
|
||||
<select id="selectTestCaseList" parameterType="TestCase" resultMap="TestCaseResult">
|
||||
<include refid="selectTestCaseVo"/>
|
||||
<where>
|
||||
<if test="groupId != null "> and group_id = #{groupId}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="importance != null "> and importance = #{importance}</if>
|
||||
<if test="status != null "> and status = #{status}</if>
|
||||
<if test="groupId != null ">and group_id = #{groupId}</if>
|
||||
<if test="projectId != null ">and project_id = #{projectId}</if>
|
||||
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
||||
<if test="importance != null ">and importance = #{importance}</if>
|
||||
<if test="status != null ">and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -51,7 +62,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="groupId != null">#{groupId},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
@@ -63,7 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTestCase" parameterType="TestCase">
|
||||
@@ -84,7 +95,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteTestCaseById" parameterType="Long">
|
||||
delete from test_case where id = #{id}
|
||||
delete
|
||||
from test_case
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTestCaseByIds" parameterType="String">
|
||||
|
||||
@@ -1,71 +1,100 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.test.test.mapper.TestCaseStepMapper">
|
||||
|
||||
<resultMap type="TestCaseStep" id="TestCaseStepResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="caseId" column="case_id" />
|
||||
<result property="name" column="name" />
|
||||
<result property="stepNum" column="step_num" />
|
||||
<result property="type" column="type" />
|
||||
<result property="requestMethod" column="request_method" />
|
||||
<result property="requestUrl" column="request_url" />
|
||||
<result property="requestBody" column="request_body" />
|
||||
<result property="requestHeader" column="request_header" />
|
||||
<result property="requestParams" column="request_params" />
|
||||
<result property="apiHttpId" column="api_http_id" />
|
||||
<result property="apiHost" column="api_host" />
|
||||
<result property="apiPort" column="api_port" />
|
||||
<result property="apiProtocol" column="api_protocol" />
|
||||
<result property="sqlCommand" column="sql_command" />
|
||||
<result property="count" column="count" />
|
||||
<result property="async" column="async" />
|
||||
<result property="interval" column="interval" />
|
||||
<result property="breakError" column="break_error" />
|
||||
<result property="preScript" column="pre_script" />
|
||||
<result property="postScript" column="post_script" />
|
||||
<result property="assignment" column="assignment" />
|
||||
<result property="assertion" column="assertion" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="caseId" column="case_id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="stepNum" column="step_num"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="requestMethod" column="request_method"/>
|
||||
<result property="requestUrl" column="request_url"/>
|
||||
<result property="requestBody" column="request_body"/>
|
||||
<result property="requestHeader" column="request_header"/>
|
||||
<result property="requestParams" column="request_params"/>
|
||||
<result property="apiHttpId" column="api_http_id"/>
|
||||
<result property="apiHost" column="api_host"/>
|
||||
<result property="apiPort" column="api_port"/>
|
||||
<result property="apiProtocol" column="api_protocol"/>
|
||||
<result property="sqlCommand" column="sql_command"/>
|
||||
<result property="count" column="count"/>
|
||||
<result property="async" column="async"/>
|
||||
<result property="interval" column="interval"/>
|
||||
<result property="breakError" column="break_error"/>
|
||||
<result property="preScript" column="pre_script"/>
|
||||
<result property="postScript" column="post_script"/>
|
||||
<result property="assignment" column="assignment"/>
|
||||
<result property="assertion" column="assertion"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTestCaseStepVo">
|
||||
select id, parent_id, case_id, name, step_num, type, request_method, request_url, request_body, request_header, request_params, api_http_id, api_host, api_port, api_protocol, sql_command, count, async, interval, break_error, pre_script, post_script, assignment, assertion, del_flag, create_by, create_time, update_by, update_time from test_case_step
|
||||
select id,
|
||||
parent_id,
|
||||
case_id,
|
||||
name,
|
||||
step_num,
|
||||
type,
|
||||
request_method,
|
||||
request_url,
|
||||
request_body,
|
||||
request_header,
|
||||
request_params,
|
||||
api_http_id,
|
||||
api_host,
|
||||
api_port,
|
||||
api_protocol,
|
||||
sql_command,
|
||||
count,
|
||||
async,
|
||||
interval,
|
||||
break_error,
|
||||
pre_script,
|
||||
post_script,
|
||||
assignment,
|
||||
assertion,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from test_case_step
|
||||
</sql>
|
||||
|
||||
<select id="selectTestCaseStepList" parameterType="TestCaseStep" resultMap="TestCaseStepResult">
|
||||
<include refid="selectTestCaseStepVo"/>
|
||||
<where>
|
||||
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||
<if test="caseId != null "> and case_id = #{caseId}</if>
|
||||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
||||
<if test="stepNum != null "> and step_num = #{stepNum}</if>
|
||||
<if test="type != null "> and type = #{type}</if>
|
||||
<if test="requestMethod != null and requestMethod != ''"> and request_method = #{requestMethod}</if>
|
||||
<if test="requestUrl != null and requestUrl != ''"> and request_url = #{requestUrl}</if>
|
||||
<if test="requestBody != null and requestBody != ''"> and request_body = #{requestBody}</if>
|
||||
<if test="requestHeader != null and requestHeader != ''"> and request_header = #{requestHeader}</if>
|
||||
<if test="requestParams != null and requestParams != ''"> and request_params = #{requestParams}</if>
|
||||
<if test="apiHttpId != null "> and api_http_id = #{apiHttpId}</if>
|
||||
<if test="apiHost != null and apiHost != ''"> and api_host = #{apiHost}</if>
|
||||
<if test="apiPort != null "> and api_port = #{apiPort}</if>
|
||||
<if test="apiProtocol != null and apiProtocol != ''"> and api_protocol = #{apiProtocol}</if>
|
||||
<if test="sqlCommand != null and sqlCommand != ''"> and sql_command = #{sqlCommand}</if>
|
||||
<if test="count != null "> and count = #{count}</if>
|
||||
<if test="async != null "> and async = #{async}</if>
|
||||
<if test="interval != null "> and interval = #{interval}</if>
|
||||
<if test="breakError != null and breakError != ''"> and break_error = #{breakError}</if>
|
||||
<if test="preScript != null and preScript != ''"> and pre_script = #{preScript}</if>
|
||||
<if test="postScript != null and postScript != ''"> and post_script = #{postScript}</if>
|
||||
<if test="assignment != null and assignment != ''"> and assignment = #{assignment}</if>
|
||||
<if test="assertion != null and assertion != ''"> and assertion = #{assertion}</if>
|
||||
<if test="parentId != null ">and parent_id = #{parentId}</if>
|
||||
<if test="caseId != null ">and case_id = #{caseId}</if>
|
||||
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
|
||||
<if test="stepNum != null ">and step_num = #{stepNum}</if>
|
||||
<if test="type != null ">and type = #{type}</if>
|
||||
<if test="requestMethod != null and requestMethod != ''">and request_method = #{requestMethod}</if>
|
||||
<if test="requestUrl != null and requestUrl != ''">and request_url = #{requestUrl}</if>
|
||||
<if test="requestBody != null and requestBody != ''">and request_body = #{requestBody}</if>
|
||||
<if test="requestHeader != null and requestHeader != ''">and request_header = #{requestHeader}</if>
|
||||
<if test="requestParams != null and requestParams != ''">and request_params = #{requestParams}</if>
|
||||
<if test="apiHttpId != null ">and api_http_id = #{apiHttpId}</if>
|
||||
<if test="apiHost != null and apiHost != ''">and api_host = #{apiHost}</if>
|
||||
<if test="apiPort != null ">and api_port = #{apiPort}</if>
|
||||
<if test="apiProtocol != null and apiProtocol != ''">and api_protocol = #{apiProtocol}</if>
|
||||
<if test="sqlCommand != null and sqlCommand != ''">and sql_command = #{sqlCommand}</if>
|
||||
<if test="count != null ">and count = #{count}</if>
|
||||
<if test="async != null ">and async = #{async}</if>
|
||||
<if test="interval != null ">and interval = #{interval}</if>
|
||||
<if test="breakError != null and breakError != ''">and break_error = #{breakError}</if>
|
||||
<if test="preScript != null and preScript != ''">and pre_script = #{preScript}</if>
|
||||
<if test="postScript != null and postScript != ''">and post_script = #{postScript}</if>
|
||||
<if test="assignment != null and assignment != ''">and assignment = #{assignment}</if>
|
||||
<if test="assertion != null and assertion != ''">and assertion = #{assertion}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@@ -105,7 +134,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="caseId != null">#{caseId},</if>
|
||||
@@ -135,7 +164,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTestCaseStep" parameterType="TestCaseStep">
|
||||
@@ -174,7 +203,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</update>
|
||||
|
||||
<delete id="deleteTestCaseStepById" parameterType="Long">
|
||||
delete from test_case_step where id = #{id}
|
||||
delete
|
||||
from test_case_step
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTestCaseStepByIds" parameterType="String">
|
||||
|
||||
@@ -5,19 +5,28 @@
|
||||
<mapper namespace="com.test.test.mapper.TestGroupMapper">
|
||||
|
||||
<resultMap type="TestGroup" id="TestGroupResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="type" column="type" />
|
||||
<result property="name" column="name" />
|
||||
<result property="delFlag" column="del_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="id" column="id"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="type" column="type"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTestGroupVo">
|
||||
select id, parent_id, type, name, del_flag, create_by, create_time, update_by, update_time from test_group
|
||||
select id,
|
||||
parent_id,
|
||||
type,
|
||||
name,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from test_group
|
||||
</sql>
|
||||
|
||||
<select id="selectTestGroupList" parameterType="String" resultMap="TestGroupResult">
|
||||
|
||||
107
test-test/src/main/resources/mapper/test/TestHttpMapper.xml
Normal file
107
test-test/src/main/resources/mapper/test/TestHttpMapper.xml
Normal file
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.test.test.mapper.TestHttpMapper">
|
||||
|
||||
<resultMap type="TestHttp" id="TestHttpResult">
|
||||
<result property="id" column="id"/>
|
||||
<result property="name" column="name"/>
|
||||
<result property="protocol" column="protocol"/>
|
||||
<result property="host" column="host"/>
|
||||
<result property="port" column="port"/>
|
||||
<result property="basePath" column="basePath"/>
|
||||
<result property="header" column="header"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTestHttpVo">
|
||||
select id,
|
||||
name,
|
||||
protocol,
|
||||
host,
|
||||
port,
|
||||
basePath,
|
||||
header,
|
||||
del_flag,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from test_http
|
||||
</sql>
|
||||
|
||||
<select id="selectTestHttpList" resultMap="TestHttpResult">
|
||||
<include refid="selectTestHttpVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectTestHttpById" parameterType="Long" resultMap="TestHttpResult">
|
||||
<include refid="selectTestHttpVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertTestHttp" parameterType="TestHttp" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into test_http
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">name,</if>
|
||||
<if test="protocol != null">protocol,</if>
|
||||
<if test="host != null">host,</if>
|
||||
<if test="port != null">port,</if>
|
||||
<if test="basePath != null">basePath,</if>
|
||||
<if test="header != null">header,</if>
|
||||
<if test="delFlag != null">del_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
<if test="protocol != null">#{protocol},</if>
|
||||
<if test="host != null">#{host},</if>
|
||||
<if test="port != null">#{port},</if>
|
||||
<if test="basePath != null">#{basePath},</if>
|
||||
<if test="header != null">#{header},</if>
|
||||
<if test="delFlag != null">#{delFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTestHttp" parameterType="TestHttp">
|
||||
update test_http
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="name != null">name = #{name},</if>
|
||||
<if test="protocol != null">protocol = #{protocol},</if>
|
||||
<if test="host != null">host = #{host},</if>
|
||||
<if test="port != null">port = #{port},</if>
|
||||
<if test="basePath != null">basePath = #{basePath},</if>
|
||||
<if test="header != null">header = #{header},</if>
|
||||
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteTestHttpById" parameterType="Long">
|
||||
delete
|
||||
from test_http
|
||||
where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteTestHttpByIds" parameterType="String">
|
||||
delete from test_http where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user