package com.casic.missiles.model.system;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 系统管理-常用工具-原始记录模板/证书报告模板表
 * </p>
 *
 * @author wangpeng
 * @since 2022-12-01
 */
@ColumnWidth(30)
@HeadRowHeight(15)
@ContentRowHeight(20)
@ContentStyle(borderLeft = BorderStyleEnum.THIN, borderBottom = BorderStyleEnum.THIN, borderTop = BorderStyleEnum.THIN, borderRight = BorderStyleEnum.THIN)
@ExcelIgnoreUnannotated
@ApiModel
@Data
@TableName("system_template")
public class SystemTemplate implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id", dataType = "Long", required = true)
    @NotNull(message = "主键id不能为空")
    @TableId("id")
    private Long id;

    /**
     * 模板编号
     */
    @ExcelProperty("模板编号")
    @ApiModelProperty(value = "原始记录模板/证书报告模板编号", dataType = "String")
    @NotBlank(message = "编号不能为空")
    @TableField("template_no")
    private String templateNo;

    /**
     * 模板名称
     */
    @ExcelProperty("模板名称")
    @ApiModelProperty(value = "原始记录模板/证书报告模板表名称", dataType = "String")
    @NotBlank(message = "名称不能为空")
    @TableField("template_name")
    private String templateName;

    /**
     * 原始记录模板或证书报告模板-字典code
     */
    @ApiModelProperty(value = "原始记录模板/证书报告模板-字典code", dataType = "String")
    @NotBlank(message = "类型不能为空")
    @TableField("template_type")
    private String templateType;

    @ApiModelProperty(value = "证书类别（证书报告）-字典code", dataType = "String")
    @TableField("certification_type")
    private String certificationType;

    /**
     * 模板描述
     */
    @ExcelProperty("模板描述")
    @ApiModelProperty(value = "原始记录模板/证书报告模板描述", dataType = "String")
    @TableField("template_desc")
    private String templateDesc;

    /**
     * 模板创建人
     */
    @ExcelProperty("模板创建人")
    @ApiModelProperty(value = "原始记录模板/证书报告模板创建人", dataType = "String")
    @NotBlank(message = "创建人不能为空")
    @TableField("template_creator")
    private String templateCreator;

    /**
     * minio存储文件名
     */
    @ApiModelProperty(value = "上传文件返回文件名", dataType = "String")
    @NotBlank(message = "文件不能为空")
    @TableField("minio_file_name")
    private String minioFileName;

    /**
     * 删除标记
     */
    @ApiModelProperty(hidden = true)
    @TableField("is_del")
    private Integer isDel;

    /**
     * 创建时间
     */
    @ExcelProperty("创建时间")
    @ApiModelProperty(value = "创建时间（列表接口参数）", dataType = "String")
    @TableField("create_time")
    private String createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty(hidden = true)
    @TableField("update_time")
    private String updateTime;

    @ApiModelProperty(hidden = true)
//    @NotEmpty(message = "可使用人不能为空")
    @TableField(exist = false)
    private List<Long> userIdList;
}
