From 337797b0ede183b5c87255e3864dea51d5cd35ba Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Mon, 10 Mar 2025 10:12:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detection/pojo/param/SimulateDetectionParam.java | 4 ++++ .../script/pojo/constant/PqScriptValidMessage.java | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 detection/src/main/java/com/njcn/gather/script/pojo/constant/PqScriptValidMessage.java diff --git a/detection/src/main/java/com/njcn/gather/detection/pojo/param/SimulateDetectionParam.java b/detection/src/main/java/com/njcn/gather/detection/pojo/param/SimulateDetectionParam.java index 4e4b43d5..8d1b3f02 100644 --- a/detection/src/main/java/com/njcn/gather/detection/pojo/param/SimulateDetectionParam.java +++ b/detection/src/main/java/com/njcn/gather/detection/pojo/param/SimulateDetectionParam.java @@ -1,10 +1,12 @@ package com.njcn.gather.detection.pojo.param; +import com.njcn.gather.script.pojo.constant.PqScriptValidMessage; import com.njcn.gather.source.pojo.constant.PqSourceValidMessage; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; /** * @author caozehui @@ -29,6 +31,7 @@ public class SimulateDetectionParam { */ private String scriptId; + @NotNull(message = PqScriptValidMessage.INDEX_NOT_NULL) private Integer scriptIndex; /** @@ -40,5 +43,6 @@ public class SimulateDetectionParam { /** * 脚本值类型 1绝对值脚本、2相对值脚本 */ + @NotNull(message = PqScriptValidMessage.VALUE_TYPE_NOT_NULL) private int valueType; } diff --git a/detection/src/main/java/com/njcn/gather/script/pojo/constant/PqScriptValidMessage.java b/detection/src/main/java/com/njcn/gather/script/pojo/constant/PqScriptValidMessage.java new file mode 100644 index 00000000..c33ea6cd --- /dev/null +++ b/detection/src/main/java/com/njcn/gather/script/pojo/constant/PqScriptValidMessage.java @@ -0,0 +1,11 @@ +package com.njcn.gather.script.pojo.constant; + +/** + * @author caozehui + * @data 2025-03-10 + */ +public interface PqScriptValidMessage { + String INDEX_NOT_NULL = "index不能为空"; + + String VALUE_TYPE_NOT_NULL = "脚本值类型不能为空"; +}