From 37ac98008551fd8925a62bc3a28a8c66f3bdc921 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 30 Oct 2024 11:48:20 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E9=AB=98=E7=BA=A7=E6=90=9C=E7=B4=A2Boolean=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6=E5=80=BC=E7=AD=9B=E9=80=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1048317 --user=宋昌昌 【接口测试】MOCK-高级搜索-状态等于开启-搜索后数据显示错误 https://www.tapd.cn/55049933/s/1601857 --- .../system/constants/UserViewConditionValueType.java | 2 +- .../java/io/metersphere/system/service/UserViewService.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/constants/UserViewConditionValueType.java b/backend/services/system-setting/src/main/java/io/metersphere/system/constants/UserViewConditionValueType.java index b16208b0df..1856a65951 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/constants/UserViewConditionValueType.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/constants/UserViewConditionValueType.java @@ -5,5 +5,5 @@ package io.metersphere.system.constants; * @CreateTime: 2024-09-02 10:47 */ public enum UserViewConditionValueType { - ARRAY,STRING,INT,FLOAT + ARRAY,STRING,INT,FLOAT,BOOLEAN } diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/service/UserViewService.java b/backend/services/system-setting/src/main/java/io/metersphere/system/service/UserViewService.java index d1b1b5272a..26068db702 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/service/UserViewService.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/service/UserViewService.java @@ -1,5 +1,6 @@ package io.metersphere.system.service; +import io.metersphere.sdk.dto.CombineCondition; import io.metersphere.sdk.exception.MSException; import io.metersphere.sdk.util.BeanUtils; import io.metersphere.sdk.util.EnumValidator; @@ -16,7 +17,6 @@ import io.metersphere.system.dto.UserViewDTO; import io.metersphere.system.dto.UserViewListGroupedDTO; import io.metersphere.system.dto.request.UserViewAddRequest; import io.metersphere.system.dto.request.UserViewUpdateRequest; -import io.metersphere.sdk.dto.CombineCondition; import io.metersphere.system.mapper.ExtUserViewMapper; import io.metersphere.system.mapper.UserViewConditionMapper; import io.metersphere.system.mapper.UserViewMapper; @@ -197,6 +197,8 @@ public class UserViewService { return UserViewConditionValueType.INT.name(); } else if (value instanceof Float || value instanceof Double) { return UserViewConditionValueType.FLOAT.name(); + } else if (value instanceof Boolean) { + return UserViewConditionValueType.BOOLEAN.name(); } else { return UserViewConditionValueType.STRING.name(); } @@ -214,6 +216,8 @@ public class UserViewService { return Long.valueOf(valueStr); case FLOAT: return Double.valueOf(valueStr); + case BOOLEAN: + return Boolean.valueOf(valueStr); default: return valueStr; }