From 970ad71a5d2d2766c32db9d544b656a9453a62c8 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 14 Jul 2020 22:59:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/openapi/scan/support/param/ImgTask.java | 6 +++--- .../java/com/epmet/openapi/scan/support/param/TextTask.java | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) 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; }