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_config
 *
 * @author ailanyin
 * @version 1.0
 * @since 2023-05-24 20:06:17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_config")
public class SysConfig 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 configId;

    @Excel(name = "参数名称", width = 25)
    @NotBlank(message = "参数名称不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 30, message = "参数名称不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String configName;

    @Excel(name = "参数键名", width = 30)
    @NotBlank(message = "参数键名不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 50, message = "参数键名不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String configKey;

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

    @Excel(name = "系统内置", width = 20, replace = {"是_Y", "否_N"})
    @NotBlank(message = "系统内置不能为空", groups = {AddGroup.class, EditGroup.class})
    @Size(max = 1, message = "系统内置不能超过{max}个字符", groups = {AddGroup.class, EditGroup.class})
    private String configType;

}
