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

import cn.reghao.file.api.dto.ObjectMeta;
import cn.reghao.tnb.file.app.zdisk.model.po.DiskFile;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

/**
 * @author reghao
 * @date 2023-11-13 10:00:50
 */
@NoArgsConstructor
@Setter
@Getter
public class DiskFileDetail {
    private String fileId;
    private int fileType;
    private String filename;
    private String url;

    public DiskFileDetail(ObjectMeta objectMeta, String signedUrl) {
        this.fileId = objectMeta.getObjectId();
        this.fileType = objectMeta.getFileType();
        this.filename = objectMeta.getFilename();
        this.url = signedUrl;
    }

    public DiskFileDetail(DiskFile diskFile) {
        this.fileId = diskFile.getFileId();
        this.fileType = diskFile.getFileType();
        this.filename = diskFile.getFilename();
    }
}
