package com.ningdatech.pmapi.expert.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * <p>
 * ReviewTemplateSettingsDTO
 * </p>
 *
 * @author WendyYang
 * @since 17:06 2023/2/14
 */
@Data
public class ReviewTemplateSettingsDTO {

    @ApiModelProperty("序号")
    @NotNull(message = "序号不能为空")
    private Integer serialNo;

    @ApiModelProperty("标题")
    @NotBlank(message = "标题不能为空")
    private String title;

    @Valid
    @ApiModelProperty("选项")
    @NotEmpty(message = "选项不能为空")
    private List<OptionDTO> options;

    @ApiModelProperty("选择类型：1 单选、2 多选")
    @NotNull(message = "选择类型不能为空")
    private Integer optionType;

    @Data
    @ApiModel("选项实体")
    public static class OptionDTO {

        @ApiModelProperty("序号")
        @NotNull(message = "序号不能为空")
        private Integer serialNo;

        @ApiModelProperty("选项内容")
        @NotBlank(message = "选项内容不能为空")
        private String option;

    }


}
