diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java index 2ec15a9593..487485b7fc 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/ImgTask.java @@ -2,7 +2,7 @@ package com.epmet.openapi.scan.support.param; import lombok.Data; -import javax.validation.constraints.NotNull; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -20,12 +20,12 @@ public class ImgTask implements Serializable { * 要检测的数据id 非必填 * * */ - @NotNull(message = "dataId不能为空") + @NotBlank(message = "dataId不能为空") private String dataId; /** * 图片url 必填 */ - @NotNull(message = "图片URL不能为空") + @NotBlank(message = "图片URL不能为空") private String url; } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java index aeb976506c..08215e3e5b 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/support/param/TextTask.java @@ -1,7 +1,9 @@ package com.epmet.openapi.scan.support.param; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -19,10 +21,13 @@ public class TextTask implements Serializable { * 要检测的数据id 非必填 * * */ + @NotBlank(message = "dataId不能为空") private String dataId; /** * 文本内容 必填 最多不能超过10000 */ + @NotBlank(message = "待检测文本不能为空") + @Length(max = 10000,message = "待检测文本最大为10000") private String content; }