package com.gxwebsoft.common.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 字典数据
 *
 * @author WebSoft
 * @since 2020-03-14 11:29:04
 */
@Data
@Schema(description = "字典数据(业务类)")
@TableName("sys_dict_data")
public class DictData implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "字典数据id")
    @TableId(type = IdType.AUTO)
    private Integer dictDataId;

    @Schema(description = "字典id")
    private Integer dictId;

    @Schema(description = "字典数据标识")
    private String dictDataCode;

    @Schema(description = "字典数据名称")
    private String dictDataName;

    @Schema(description = "字段类型")
    private String type;

    @Schema(description = "字段名称")
    @TableField(exist = false)
    private String text;

    @Schema(description = "字段名称")
    @TableField(exist = false)
    private String label;

    @Schema(description = "字段值")
    @TableField(exist = false)
    private String value;

    @Schema(description = "预设字段:路由地址")
    private String path;

    @Schema(description = "预设字段:组件路径")
    private String component;

    @Schema(description = "排序号")
    private Integer sortNumber;

    @Schema(description = "备注")
    private String comments;

    @Schema(description = "是否删除, 0否, 1是")
    @TableLogic
    private Integer deleted;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @Schema(description = "修改时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @Schema(description = "字典代码")
    @TableField(exist = false)
    private String dictCode;

    @Schema(description = "字典名称")
    @TableField(exist = false)
    private String dictName;

    @Schema(description = "租户id")
    private Integer tenantId;

    public String getText() {
      return this.dictDataName;
    }
    public String getLabel() {
      return this.dictDataName;
    }
    public String getValue() {
      return this.dictDataCode;
    }
}
