package com.inspect.system.domain;

import com.inspect.base.core.annotation.Excel;
import com.inspect.base.core.annotation.Excel.ColumnType;
import com.inspect.base.core.web.domain.BaseEntity;

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

import lombok.Setter;

@Setter
public class SysConfig extends BaseEntity {
    private static final long serialVersionUID = 1L;
    @Excel(
            name = "参数主键",
            cellType = ColumnType.NUMERIC
    )
    private Long configId;
    @Excel(
            name = "参数名称"
    )
    private String configName;
    @Excel(
            name = "参数键名"
    )
    private String configKey;
    @Excel(
            name = "参数键值"
    )
    private String configValue;
    @Excel(
            name = "系统内置",
            readConverterExp = "Y=是,N=否"
    )
    private String configType;

    public Long getConfigId() {
        return this.configId;
    }

    @NotBlank(
            message = "参数名称不能为空"
    )
    @Size(
            min = 0,
            max = 100,
            message = "参数名称不能超过100个字符"
    )
    public String getConfigName() {
        return this.configName;
    }

    @NotBlank(
            message = "参数键名长度不能为空"
    )
    @Size(
            min = 0,
            max = 100,
            message = "参数键名长度不能超过100个字符"
    )
    public String getConfigKey() {
        return this.configKey;
    }

    @NotBlank(
            message = "参数键值不能为空"
    )
    @Size(
            min = 0,
            max = 500,
            message = "参数键值长度不能超过500个字符"
    )
    public String getConfigValue() {
        return this.configValue;
    }

    public String getConfigType() {
        return this.configType;
    }

    @Override
    public String toString() {
        return "SysConfig{" +
                "configId=" + configId +
                ", configName='" + configName + '\'' +
                ", configKey='" + configKey + '\'' +
                ", configValue='" + configValue + '\'' +
                ", configType='" + configType + '\'' +
                '}';
    }
}
