From 08e2641ccb8f2ec14d35199bf9012d122f52b99f Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Sat, 18 Sep 2021 18:23:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89)=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9JsonSchema-=E9=AB=98=E7=BA=A7=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=EF=BC=8Cobject=E5=92=8Carray=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=BA=86=E6=9C=80=E5=A4=A7=E6=9C=80=E5=B0=8F=E6=95=B0=E9=87=8F?= =?UTF-8?q?=20--bug=3D1006778=20--user=3D=E8=B5=B5=E5=8B=87=20=E3=80=90?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95=E3=80=91JsonSchema-?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E8=AE=BE=E7=BD=AE=EF=BC=8Cobject=E5=92=8Carr?= =?UTF-8?q?ay=E6=98=BE=E7=A4=BA=E4=BA=86=E6=9C=80=E5=A4=A7=E6=9C=80?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=E9=87=8F=20https://www.tapd.cn/55049933/s/10?= =?UTF-8?q?48677?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../metersphere/api/service/ApiDefinitionService.java | 11 ++++++++--- .../common/json-schema/schema/editor/main.vue | 5 +++-- .../common/json-schema/schema/editor/type/array.js | 2 -- .../common/json-schema/schema/editor/type/object.js | 6 ++---- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java index b79d5a3791..93155591cd 100644 --- a/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java +++ b/backend/src/main/java/io/metersphere/api/service/ApiDefinitionService.java @@ -570,6 +570,7 @@ public class ApiDefinitionService { /** * 如果是MS格式,带用例导出,最后创建用例,重新设置接口id + * * @param cases * @param originId * @param newId @@ -759,7 +760,10 @@ public class ApiDefinitionService { result.getResponseResult().setConsole(res.getConsole()); cache.put(res.getTestId(), result); } else { - MSException.throwException(Translator.get("test_not_found")); + RequestResult result = new RequestResult(); + result.getResponseResult().setConsole(res.getConsole()); + cache.put(res.getTestId(), result); + //MSException.throwException(Translator.get("test_not_found")); } } @@ -1427,6 +1431,7 @@ public class ApiDefinitionService { /** * 用例自定义排序 + * * @param request */ public void updateOrder(ResetOrderRequest request) { @@ -1448,9 +1453,9 @@ public class ApiDefinitionService { } public long countEffectiveByProjectId(String projectId) { - if(StringUtils.isEmpty(projectId)){ + if (StringUtils.isEmpty(projectId)) { return 0; - }else { + } else { ApiDefinitionExample example = new ApiDefinitionExample(); example.createCriteria().andProjectIdEqualTo(projectId).andStatusNotEqualTo("Trash"); return apiDefinitionMapper.countByExample(example); diff --git a/frontend/src/business/components/common/json-schema/schema/editor/main.vue b/frontend/src/business/components/common/json-schema/schema/editor/main.vue index 5ee4971a2b..abc3926b07 100644 --- a/frontend/src/business/components/common/json-schema/schema/editor/main.vue +++ b/frontend/src/business/components/common/json-schema/schema/editor/main.vue @@ -47,7 +47,7 @@ -

基础设置

@@ -328,9 +328,10 @@ }, onSetting() { this.modalVisible = true; + this.advancedValue = {}; this.advancedValue = this.advanced.value for (const k in this.advancedValue) { - if (this.pickValue[k]) this.advancedValue[k] = this.pickValue[k] + this.advancedValue[k] = this.pickValue[k] } }, handleClose() { diff --git a/frontend/src/business/components/common/json-schema/schema/editor/type/array.js b/frontend/src/business/components/common/json-schema/schema/editor/type/array.js index a22cb8b809..d9d81ea86b 100644 --- a/frontend/src/business/components/common/json-schema/schema/editor/type/array.js +++ b/frontend/src/business/components/common/json-schema/schema/editor/type/array.js @@ -1,6 +1,4 @@ const value = { - minItems:null, - maxItems:null, description: null } const attr = { diff --git a/frontend/src/business/components/common/json-schema/schema/editor/type/object.js b/frontend/src/business/components/common/json-schema/schema/editor/type/object.js index ba939a60d7..397ef7cfb3 100644 --- a/frontend/src/business/components/common/json-schema/schema/editor/type/object.js +++ b/frontend/src/business/components/common/json-schema/schema/editor/type/object.js @@ -1,7 +1,5 @@ const value = { - description: null, - maxProperties: null, - minProperties: null + description: null } const attr = { description: { @@ -18,4 +16,4 @@ const attr = { } } const wrapper = {value, attr} -export default wrapper \ No newline at end of file +export default wrapper