package com.ruoyi.file.object;

import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.web.multipart.MultipartFile;

import java.util.Date;

@Data
@Accessors(chain = true)
public final class UploadResult
{
    private      int     state             = 0;
    private      boolean success           = false;
    private      String  filePath; // 文件磁盘路径
    private      String  thumbnailFilePath; // 缩略图磁盘路径
    private      String  fileUrl; // 文件网络地址
    private      String  thumbnailFileUrl; // 缩略图网络地址
    private long    fileSize          = 0; // 文件大小
    private      long    thumbnailFileSize = 0; // 缩略图大小
    private Date    time              = null;

    public void Finish(boolean ok)
    {
        state = 1;
        success = ok;
        time = new Date();
    }
}
