zhuguifei
2025-04-28 442928123f63ee497d766f9a7a14f0a6ee067e25
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
package org.jeecg.modules.doc.entity;
 
import java.io.Serializable;
import java.util.Date;
 
import cn.hutool.core.util.IdUtil;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
 
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.common.util.DateUtils;
import org.jeecg.modules.doc.vo.UploadFileResult;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
 
/**
 * @Description: doc_file
 * @Author: jeecg-boot
 * @Date:   2022-07-04
 * @Version: V1.0
 */
@Data
@TableName("doc_file")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="doc_file对象", description="doc_file")
public class DocFile implements Serializable {
    private static final long serialVersionUID = 1L;
 
    /**fileId*/
    @TableId
    @Excel(name = "fileId", width = 15)
    @ApiModelProperty(value = "fileId")
    private String fileId;
    /**文件大小*/
    @Excel(name = "文件大小", width = 15)
    @ApiModelProperty(value = "文件大小")
    private Long fileSize;
    /**文件状态(0-失效,1-生效)*/
    @Excel(name = "文件状态(0-失效,1-生效)", width = 15)
    @ApiModelProperty(value = "文件状态(0-失效,1-生效)")
    private Integer fileStatus;
    /**文件url*/
    @Excel(name = "文件url", width = 15)
    @ApiModelProperty(value = "文件url")
    private String fileUrl;
    /**md5唯一标识*/
    @Excel(name = "md5唯一标识", width = 15)
    @ApiModelProperty(value = "md5唯一标识")
    private String identifier;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    private String createBy;
    /**创建时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**更新人*/
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    /**更新时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    /**存储类型*/
    @Excel(name = "存储类型", width = 15)
    @ApiModelProperty(value = "存储类型")
    private Integer storageType;
 
    public DocFile() {
    }
 
    public DocFile(UploadFileResult uploadFileResult) {
        this.fileId = IdUtil.getSnowflakeNextIdStr();
        this.fileUrl = uploadFileResult.getFileUrl();
        this.fileSize = uploadFileResult.getFileSize();
        this.fileStatus = 1;
        this.identifier = uploadFileResult.getIdentifier();
        this.createTime = DateUtils.getDate();
 
    }
 
    public DocFile(String saveFileUrl, long length, String md5Str, String userId) {
        this.fileId = IdUtil.getSnowflakeNextIdStr();
        this.fileUrl = saveFileUrl;
        this.fileSize = length;
        this.fileStatus = 1;
        this.identifier = md5Str;
        this.createTime = DateUtils.getDate();
        this.createBy = userId;
    }
}