package com.ruoyi.basic.entity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.ruoyi.basic.entity.dto.StorageBlobDTO; import lombok.Data; import java.io.Serializable; /** * 通用文件上传的附件信息 实体类 * * @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; // // /** // * 创建时间 // */ // @TableField(value = "create_time", // fill = FieldFill.INSERT, // typeHandler = LocalDateTimeTypeHandler.class) // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") // private LocalDateTime createTime; // /** // * 更新时间 // */ // @TableField(value = "update_time", // fill = FieldFill.INSERT_UPDATE, // typeHandler = LocalDateTimeTypeHandler.class) // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") // private LocalDateTime 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; @TableField(exist = false) private StorageBlobDTO storageBlobDTO; public StorageAttachment(String fileType, Long recordType, Long recordId) { this.name = fileType; this.recordType = recordType; this.recordId = recordId; } }