test
parent
728ed85b90
commit
5c2efc6c91
|
|
@ -45,6 +45,16 @@ public enum QuestionTypeEnum {
|
|||
*/
|
||||
private final String desc;
|
||||
|
||||
/**
|
||||
* 题型枚举取值说明
|
||||
*/
|
||||
public static final String REMARKS = "题型枚举: single=>单选;multiple=>多选;judge=>判断;fill=>填空;short=>简答";
|
||||
|
||||
/**
|
||||
* 题型编码校验正则
|
||||
*/
|
||||
public static final String PATTERN = "single|multiple|judge|fill|short";
|
||||
|
||||
/**
|
||||
* 根据编码获取枚举
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.qinan.cedu.model.dto;
|
|||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.qinan.cedu.enums.QuestionTypeEnum;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
|
|
@ -21,9 +22,9 @@ public class PaperQuestionSaveDTO {
|
|||
@NotNull(message = "试卷id不能为空")
|
||||
private Long paperId;
|
||||
|
||||
@ApiModelProperty(value = "试题类型:single单选/multiple多选", required = true)
|
||||
@ApiModelProperty(value = QuestionTypeEnum.REMARKS, required = true)
|
||||
@NotBlank(message = "试题类型不能为空")
|
||||
@Pattern(regexp = "single|multiple", message = "试题类型只能填写single(单选)或multiple(多选)")
|
||||
@Pattern(regexp = QuestionTypeEnum.PATTERN, message = "试题类型只能填写" + QuestionTypeEnum.REMARKS)
|
||||
private String questionType;
|
||||
|
||||
@ApiModelProperty(value = "题目内容", required = true)
|
||||
|
|
|
|||
Loading…
Reference in New Issue