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;