From dba11130cd3415895bf2826529b1b9d35b4e7aee Mon Sep 17 00:00:00 2001 From: AgAngle <1323481023@qq.com> Date: Fri, 30 Aug 2024 14:58:39 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=94=A8=E4=BE=8B=E7=AE=A1=E7=90=86):?= =?UTF-8?q?=20=E9=AB=98=E7=BA=A7=E6=90=9C=E7=B4=A2=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=93=E6=9E=84=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --task=1016127 --user=陈建星 高级搜索-高级搜索数据结构设计-后端 https://www.tapd.cn/55049933/s/1570894 --- .../io/metersphere/system/dto/sdk/CombineCondition.java | 5 +++++ .../java/io/metersphere/system/dto/sdk/CombineSearch.java | 8 -------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/CombineCondition.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/CombineCondition.java index 12364bf2f6..8f0a6a9a28 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/CombineCondition.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/CombineCondition.java @@ -2,6 +2,7 @@ package io.metersphere.system.dto.sdk; import io.metersphere.system.valid.EnumValue; import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; import lombok.Data; import org.apache.commons.lang3.StringUtils; @@ -18,6 +19,10 @@ public class CombineCondition { @Schema(description = "期望值, BETWEEN,IN,NOT_IN 时为数组, 其他为单值") private Object value; + @Schema(description = "是否是自定义字段") + @NotNull + private Boolean customField = false; + @Schema(description = "操作符", allowableValues = {"IN", "NOT_IN", "BETWEEN", "GT", "LT", "EQUALS", "NOT_EQUALS", "CONTAINS", "NOT_CONTAINS", "EMPTY", "NOT_EMPTY", "CURRENT_USER"}) @EnumValue(enumClass = CombineConditionOperator.class) diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/CombineSearch.java b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/CombineSearch.java index e09b2ea626..d015f7e484 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/CombineSearch.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/dto/sdk/CombineSearch.java @@ -22,10 +22,6 @@ public class CombineSearch { @Valid private List conditions; - @Schema(description = "自定义字段筛选条件") - @Valid - private List customFileConditions; - public List getValidConditions(List conditions) { return conditions.stream().filter(CombineCondition::valid).toList(); } @@ -34,10 +30,6 @@ public class CombineSearch { return getValidConditions(conditions); } - public List getCustomFileConditions() { - return getValidConditions(customFileConditions); - } - public String getSearchMode() { return StringUtils.isBlank(searchMode) ? SearchMode.AND.name() : searchMode; }