package cn.reghao.tnb.content.app.chat.model.dto.message;

import cn.reghao.tnb.content.app.chat.model.po.message.FileMessage;
import lombok.Getter;

/**
 * @author reghao
 * @date 2022-04-20 14:18:23
 */
@Getter
public class FileMsgResult {
    private String fileId;
    private long recordId;
    private long userId;
    private int drive;
    private Long id;
    private String originalName;
    private String path;
    private long size;
    private int source;
    private String suffix;
    private int type;
    private String url;
    private int width;
    private int height;
    private String createdAt;

    public FileMsgResult(FileMessage fileMessage, String url, long userId, String createdAt) {
        this.fileId = fileMessage.getUploadId();
        this.recordId = fileMessage.getRecordId();
        this.userId = userId;
        this.drive = 1;
        this.id = fileMessage.getRecordId();
        this.originalName = fileMessage.getFilename();
        this.path = url;
        this.size = 1;
        this.source = 1;
        this.suffix = "";
        this.type = fileMessage.getFileType();
        this.url = url;
        this.width = fileMessage.getWidth();
        this.height = fileMessage.getHeight();
        this.createdAt = createdAt;
    }
}
