package com.bonus.mongodb.damain;

import java.io.Serializable;
import java.util.Objects;
import cn.hutool.core.bean.BeanUtil;
import lombok.Data;

@Data
public class FileExportVo implements Serializable {

    private String file;

    private String fileId;

    private String fileName;

    private String contentType;

    private String suffix;

    private long fileSize;

    private String sourceId;

    private String id;

    private String fileType;
    /**
     * 资源类型
     */
    private String sourceType;

    private String updaetTime;

    private byte[] data;

    public FileExportVo(MongoFile mongoFile) {
        BeanUtil.copyProperties(mongoFile, this);
        if (Objects.nonNull(mongoFile.getContent())) {
            this.data = mongoFile.getContent().getData();
        }
        this.fileId = mongoFile.getId();
    }
}
