From 9eaa143d5400ccf7c7585b4a65606ecee2cfbdad Mon Sep 17 00:00:00 2001 From: Jianguo-Genius Date: Fri, 13 Sep 2024 11:30:36 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AF=BC=E5=87=BAmock=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B2=A1=E6=9C=89tag=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1046300 --user=宋天阳 【接口测试】接口导出-MeterSphere格式-导出Mock-未导出Mock的标签 https://www.tapd.cn/55049933/s/1578165 --- .../java/io/metersphere/api/dto/definition/ResponseBody.java | 3 ++- .../java/io/metersphere/api/dto/request/http/body/Body.java | 2 +- .../io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ResponseBody.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ResponseBody.java index b8417fb755..09c281d5d6 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ResponseBody.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/definition/ResponseBody.java @@ -1,5 +1,6 @@ package io.metersphere.api.dto.definition; +import io.metersphere.api.dto.request.http.body.Body; import io.metersphere.api.dto.request.http.body.JsonBody; import io.metersphere.api.dto.request.http.body.RawBody; import io.metersphere.api.dto.request.http.body.XmlBody; @@ -20,7 +21,7 @@ public class ResponseBody implements Serializable { @NotBlank @Size(max = 20) - private String bodyType; + private String bodyType = Body.BodyType.NONE.name(); @Valid private JsonBody jsonBody = new JsonBody(); diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/dto/request/http/body/Body.java b/backend/services/api-test/src/main/java/io/metersphere/api/dto/request/http/body/Body.java index 4cc4ce8f25..d396e8419b 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/dto/request/http/body/Body.java +++ b/backend/services/api-test/src/main/java/io/metersphere/api/dto/request/http/body/Body.java @@ -20,7 +20,7 @@ public class Body { * 同时持久化多个类型的请求体 */ @NotBlank - private String bodyType; + private String bodyType = BodyType.NONE.name(); /** * None 请求体 * 当 bodyType 为 NONE 时,使用该字段 diff --git a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml index ec75c238eb..02f6bc4599 100644 --- a/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml +++ b/backend/services/api-test/src/main/java/io/metersphere/api/mapper/ExtApiDefinitionMockMapper.xml @@ -62,6 +62,7 @@ +