From 571dcb99038fb91c810e07fe55fd199815fd7546 Mon Sep 17 00:00:00 2001 From: wangxy <1356089412@qq.com> Date: Tue, 2 Jul 2024 16:34:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=9C=A8=E7=BA=BF=E8=80=83=E8=AF=95?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/system/domain/qu/dto/QuAnswerDTO.java | 3 +++ .../main/java/com/ruoyi/system/domain/qu/dto/QuDTO.java | 5 +++++ .../com/ruoyi/system/domain/qu/dto/ext/QuDetailDTO.java | 7 +++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuAnswerDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuAnswerDTO.java index 00f0f42..4fada4c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuAnswerDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuAnswerDTO.java @@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -34,6 +36,7 @@ public class QuAnswerDTO implements Serializable { private String image; @ApiModelProperty(value = "答案内容") + @NotBlank(message = "答案内容不能为空") private String content; @ApiModelProperty(value = "答案分析") diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuDTO.java index ed2c71a..4a87d2b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/QuDTO.java @@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.util.Date; @@ -26,15 +28,18 @@ public class QuDTO implements Serializable { private String id; @ApiModelProperty(value = "题目类型") + @NotNull(message = "题目类型不能为空") private Integer quType; @ApiModelProperty(value = "1普通,2较难") + @NotNull(message = "难度等级不能为空") private Integer level; @ApiModelProperty(value = "题目图片") private String image; @ApiModelProperty(value = "题目内容") + @NotBlank(message = "题目内容不能为空") private String content; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/ext/QuDetailDTO.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/ext/QuDetailDTO.java index 9c2e673..a4d8659 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/ext/QuDetailDTO.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/qu/dto/ext/QuDetailDTO.java @@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; +import javax.validation.constraints.NotNull; import java.util.List; /** @@ -23,10 +24,12 @@ public class QuDetailDTO extends QuDTO { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "备选项列表", required=true) + @ApiModelProperty(value = "备选项列表") + @NotNull(message = "备选项列表不能为空") private List answerList; - @ApiModelProperty(value = "题库列表", required=true) + @ApiModelProperty(value = "题库列表") + @NotNull(message = "题库列表不能为空") private List repoIds;