package com.ruoyi.basic.entity;
|
|
import com.baomidou.mybatisplus.annotation.*;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.ruoyi.basic.entity.dto.StorageBlobDTO;
|
import lombok.Data;
|
import com.ruoyi.common.core.domain.BaseEntity;
|
|
import java.io.Serializable;
|
import java.util.Date;
|
|
/**
|
* 通用文件上传的附件信息 实体类
|
*
|
* @author ruoyi
|
* @date 2025-05-29
|
*/
|
@Data
|
@TableName("storage_attachment")
|
public class StorageAttachment implements Serializable {
|
|
private static final long serialVersionUID = 1L;
|
|
/**
|
*
|
*/
|
@TableId(value = "id", type = IdType.AUTO)
|
private Long id;
|
|
/** 创建时间 */
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@TableField(fill = FieldFill.INSERT)
|
private Date createTime;
|
|
/** 更新时间 */
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
private Date updateTime;
|
|
/**
|
* 逻辑删除
|
*/
|
@TableField(value = "deleted")
|
private Long deleted;
|
/**
|
* 关联的记录类型
|
*/
|
@TableField(value = "record_type")
|
private Long recordType;
|
/**
|
* 关联的记录id
|
*/
|
@TableField(value = "record_id")
|
private Long recordId;
|
/**
|
* 类型名称, 如: file, avatar (区分同一条记录不同类型的附件)
|
*/
|
@TableField(value = "name")
|
private String name;
|
/**
|
* 关联storage_blob记录id
|
*/
|
@TableField(value = "storage_blob_id")
|
private Long storageBlobId;
|
|
private StorageBlobDTO storageBlobDTO;
|
|
public StorageAttachment(String fileType, Long recordType, Long recordId) {
|
this.name = fileType;
|
this.recordType = recordType;
|
this.recordId = recordId;
|
}
|
}
|