liding
11 小时以前 71fba5328a35b449b11088e540932787220f91d8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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;
    }
}