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

import cn.reghao.tnb.oss.api.constant.ObjectType;
import cn.reghao.tnb.oss.api.dto.ObjectInfo;
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(ObjectInfo objectInfo, String size) {
        this.fileId = objectInfo.getObjectId();
        this.filename = objectInfo.getFilename();
        this.updateTime = objectInfo.getUpdateTime();
        this.size = size;
        this.fileType = objectInfo.getFileType();
        this.fileTypeStr = ObjectType.getDescByCode(objectInfo.getFileType());
    }
}
