package cn.reghao.tnb.file.app.zdisk.model.vo;

import cn.reghao.jutil.jdk.converter.DateTimeConverter;
import cn.reghao.oss.api.constant.ObjectType;
import cn.reghao.tnb.file.app.zdisk.model.po.DiskFile;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author reghao
 * @date 2024-10-30 10:24:28
 */
@AllArgsConstructor
@Getter
public class FileInfo {
    private String fileId;
    private String filename;
    private String updateTime;
    private String size;
    private int fileType;
    private String fileTypeStr;

    public FileInfo(DiskFile diskFile, String size) {
        this.fileId = diskFile.getFileId();
        this.filename = diskFile.getFilename();
        this.updateTime = DateTimeConverter.format(diskFile.getUpdateTime());
        this.size = size;
        this.fileType = diskFile.getFileType();
        this.fileTypeStr = ObjectType.getDescByCode(diskFile.getFileType());
    }
}
