新增调试按钮以及http结果记录请求头和请求体参数
This commit is contained in:
@@ -32,6 +32,14 @@ public class TestCaseResult extends BaseEntity {
|
||||
@Excel(name = "用例步骤id")
|
||||
private Long stepId;
|
||||
|
||||
/** http 请求头 */
|
||||
@Excel(name = "http 请求头")
|
||||
private String requestHeader;
|
||||
|
||||
/** http 请求体 */
|
||||
@Excel(name = "http 请求体")
|
||||
private String requestBody;
|
||||
|
||||
/** http 响应头 */
|
||||
@Excel(name = "http 响应头")
|
||||
private String responseHeader;
|
||||
|
||||
@@ -194,6 +194,8 @@ public class TestCaseServiceImpl implements ITestCaseService
|
||||
testCaseResult.setCaseId(testCase.getId());
|
||||
testCaseResult.setStepId(testCaseStep.getId());
|
||||
if (resultMap != null) {
|
||||
testCaseResult.setRequestHeader(resultMap.get("requestHeader"));
|
||||
testCaseResult.setRequestBody(resultMap.get("requestBody"));
|
||||
testCaseResult.setResponseHeader(resultMap.get("responseHeader"));
|
||||
testCaseResult.setResponseBody(resultMap.get("responseBody"));
|
||||
// 处理参数提取
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
<?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.TestCaseResultMapper">
|
||||
|
||||
<resultMap type="TestCaseResult" id="TestCaseResultResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="caseId" column="case_id" />
|
||||
<result property="stepId" column="step_id" />
|
||||
<result property="requestHeader" column="request_header" />
|
||||
<result property="requestBody" column="request_body" />
|
||||
<result property="responseHeader" column="response_header" />
|
||||
<result property="responseBody" column="response_body" />
|
||||
<result property="sqlResult" column="sql_result" />
|
||||
@@ -21,7 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectTestCaseResultVo">
|
||||
select id, case_id, step_id, response_header, response_body, sql_result, polling_count, loop_count, assignment, assertion, use_time, execute_time, status from test_case_result
|
||||
select id, case_id, step_id, request_header, request_body, response_header, response_body, sql_result, polling_count, loop_count, assignment, assertion, use_time, execute_time, status from test_case_result
|
||||
</sql>
|
||||
|
||||
<select id="selectTestCaseResultList" parameterType="TestCaseResult" resultMap="TestCaseResultResult">
|
||||
@@ -29,6 +31,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<where>
|
||||
<if test="caseId != null "> and case_id = #{caseId}</if>
|
||||
<if test="stepId != null "> and step_id = #{stepId}</if>
|
||||
<if test="requestHeader != null and requestHeader != ''"> and request_header = #{requestHeader}</if>
|
||||
<if test="requestBody != null and requestBody != ''"> and request_body = #{requestBody}</if>
|
||||
<if test="responseHeader != null and responseHeader != ''"> and response_header = #{responseHeader}</if>
|
||||
<if test="responseBody != null and responseBody != ''"> and response_body = #{responseBody}</if>
|
||||
<if test="sqlResult != null and sqlResult != ''"> and sql_result = #{sqlResult}</if>
|
||||
@@ -52,6 +56,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="caseId != null">case_id,</if>
|
||||
<if test="stepId != null">step_id,</if>
|
||||
<if test="requestHeader != null">request_header,</if>
|
||||
<if test="requestBody != null">request_body,</if>
|
||||
<if test="responseHeader != null">response_header,</if>
|
||||
<if test="responseBody != null">response_body,</if>
|
||||
<if test="sqlResult != null">sql_result,</if>
|
||||
@@ -62,10 +68,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="useTime != null">use_time,</if>
|
||||
<if test="executeTime != null">execute_time,</if>
|
||||
<if test="status != null">status,</if>
|
||||
</trim>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="caseId != null">#{caseId},</if>
|
||||
<if test="stepId != null">#{stepId},</if>
|
||||
<if test="requestHeader != null">#{requestHeader},</if>
|
||||
<if test="requestBody != null">#{requestBody},</if>
|
||||
<if test="responseHeader != null">#{responseHeader},</if>
|
||||
<if test="responseBody != null">#{responseBody},</if>
|
||||
<if test="sqlResult != null">#{sqlResult},</if>
|
||||
@@ -76,7 +84,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="useTime != null">#{useTime},</if>
|
||||
<if test="executeTime != null">#{executeTime},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
</trim>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateTestCaseResult" parameterType="TestCaseResult">
|
||||
@@ -84,6 +92,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="caseId != null">case_id = #{caseId},</if>
|
||||
<if test="stepId != null">step_id = #{stepId},</if>
|
||||
<if test="requestHeader != null">request_header = #{requestHeader},</if>
|
||||
<if test="requestBody != null">request_body = #{requestBody},</if>
|
||||
<if test="responseHeader != null">response_header = #{responseHeader},</if>
|
||||
<if test="responseBody != null">response_body = #{responseBody},</if>
|
||||
<if test="sqlResult != null">sql_result = #{sqlResult},</if>
|
||||
|
||||
Reference in New Issue
Block a user