package cn.ey.biz.module.system.controller.admin.category.vo;

import cn.ey.biz.module.system.controller.admin.i18n.vo.I18nRespVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.List;

/**
* 字典分类数据 Base VO，提供给添加、修改、详细的子 VO 使用
* 如果子 VO 存在差异的字段，请不要添加到这里，影响 Swagger 文档生成
*/
@Data
public class CategoryDataBaseVO {

    @ApiModelProperty(value = "父级节点")
    @NotNull(message = "父级节点不能为空")
    private Long pid;

    @ApiModelProperty(value = "父级节点唯一值")
    private String dataParentIdentifier;

    @ApiModelProperty(value = "分类编码")
    @NotBlank(message = "编码不能为空")
    @Size(max = 100, message = "字典标签长度不能超过100个字符")
    private String categoryCode;

    @ApiModelProperty(value = "编码唯一值")
    private String dataIdentifier;

    @ApiModelProperty(value = "编码")
    @Size(max = 100, message = "字典编码标签长度不能超过100个字符")
    private String code;

    @ApiModelProperty(value = "名称")
    @Size(max = 100, message = "字典标签长度不能超过100个字符")
    private String name;

    @ApiModelProperty(value = "字段值")
    private String value;

    @ApiModelProperty(value = "是否有子节点")
    private Integer hasChildren;

    @ApiModelProperty(value = "状态（0正常 1停用）", required = true)
    @NotNull(message = "状态（0正常 1停用）不能为空")
    private Integer status;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "多语言列表", required = true)
    @NotNull(message = "多语言列表不能为空")
    private List<I18nRespVO> langs;

    @ApiModelProperty(value = "分类版本号", example = "1")
    @NotNull(message = "分类版本不能为空", groups = CategoryBaseVO.Update.class)
    private Long categoryVersion;

    @ApiModelProperty(value = "值版本号", example = "1")
    @NotNull(message = "分类数据版本不能为空", groups = CategoryBaseVO.Update.class)
    private Long dataVersion;

    @ApiModelProperty(value = "是否最新版本", example = "1", notes = "0  否 1 是")
    private Integer newVersion;

    @ApiModelProperty(value = "排序码", example = "1")
    private Integer sort;


}
