package com.storlead.sales.mail.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.storlead.framework.mybatis.entity.SysBaseField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * <p>
 * 邮件附件表
 * </p>
 *
 * @author chenkq
 * @since 2024-06-14
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("mail_attachment")
@ApiModel(value="MailAttachmentEntity对象", description="邮件附件表")
public class MailAttachmentEntity extends SysBaseField {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "邮件id")
    @TableField("email_id")
    private Long emailId;

    @TableField("smtp_pop_id")
    private Long smtpPopId;

    @ApiModelProperty(value = "资源名称")
    @TableField("file_code")
    private String fileCode;

    @ApiModelProperty(value = "资源名称")
    @TableField("file_name")
    private String fileName;

    @ApiModelProperty(value = "资源URL")
    @TableField("file_path")
    private String filePath;

    @ApiModelProperty(value = "资源名称")
    @TableField("file_size")
    private Long fileSize;

    @ApiModelProperty(value = "资源格式")
    @TableField("file_ext")
    private String fileExt;

    @ApiModelProperty(value = "下载状态:0:下载中,1:已下载")
    @TableField("download")
    private Integer download;

    @ApiModelProperty(value = "主题")
    @TableField(exist = false)
    private String subject;

    @ApiModelProperty(value = "文件大小+单位")
    @TableField(exist = false)
    private String fileSizeName;

    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "收件时间")
    @TableField(exist = false)
    private Date sentDate;
}
