package com.gxwebsoft.common.system.entity;

import com.baomidou.mybatisplus.annotation.*;
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.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * 文件上传记录
 *
 * @author WebSoft
 * @since 2021-08-29 12:36:32
 */
@Data
@Schema(description = "文件上传记录")
@TableName("gxwebsoft_core.sys_file_record")
public class FileRecord implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(description = "主键id")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @Schema(description = "分组ID")
    private String groupId;

    @Schema(description = "文件名称")
    private String name;

    @Schema(description = "文件存储路径")
    private String path;

    @Schema(description = "文件大小")
    private Long length;

    @Schema(description = "文件类型")
    private String contentType;

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

    @Schema(description = "创建人")
    private Integer createUserId;

    @Schema(description = "AppId")
    private Integer appId;

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

    @Schema(description = "商户编号")
    private String merchantCode;

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

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

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

    @Schema(description = "文件访问地址")
    @TableField(exist = false)
    private String url;

    @Schema(description = "文件缩略图访问地址")
    @TableField(exist = false)
    private String thumbnail;

    @Schema(description = "文件下载地址")
    @TableField(exist = false)
    private String downloadUrl;

    @Schema(description = "创建人账号")
    @TableField(exist = false)
    private String createUsername;

    @Schema(description = "创建人名称")
    @TableField(exist = false)
    private String createNickname;

    @Schema(description = "用户头像")
    @TableField(exist = false)
    private String avatar;

}
