package com.qiaoba.api.system.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qiaoba.common.base.entity.BaseEntity;
import com.qiaoba.common.base.validate.AddGroup;
import com.qiaoba.common.base.validate.EditGroup;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 * 字典数据 sys_dict_data
 *
 * @author ailanyin
 * @version 1.0
 * @since 2022-09-22 04:20:28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_dict_data")
public class SysDictData extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @Excel(name = "字典编码", width = 20)
    @TableId
    @NotNull(message = "主键不能为空", groups = {EditGroup.class})
    @Size(max = 20, message = "主键不能超过{max}个字符", groups = {EditGroup.class})
    private String dictCode;

    @Excel(name = "字典标签", width = 20)
    @NotBlank(message = "字典标签不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "字典标签不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String dictLabel;

    @Excel(name = "字典键值", width = 20)
    @NotBlank(message = "字典键值不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "字典键值不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String dictValue;

    @Excel(name = "字典类型", width = 20)
    @NotBlank(message = "字典类型不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "字典类型不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String dictType;

    private String cssClass;

    private String listClass;

    @Excel(name = "状态", width = 20, replace = {"正常_1", "停用_0"})
    @NotBlank(message = "状态不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 1, message = "状态不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String status;

    @Excel(name = "字典排序", width = 20)
    private Long dictSort;

}
