package ink.wgink.module.file.pojo.dtos.v2;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @ClassName: FileUploadSuccessDTO
 * @Description: 文件上传成功
 * @Author: wanggeng
 * @Date: 2022/4/13 16:13
 * @Version: 1.0
 */
@ApiModel
public class FileUploadSuccessDTO implements Serializable {

    private static final long serialVersionUID = -532164203878483022L;

    @ApiModelProperty(name = "fileId", value = "文件ID")
    private String fileId;
    @ApiModelProperty(name = "fileName", value = "文件名称")
    private String fileName;
    @ApiModelProperty(name = "fileSize", value = "文件大小")
    private Long fileSize;
    @ApiModelProperty(name = "fileUrl", value = "文件路径")
    private String fileUrl;

    public FileUploadSuccessDTO() {
    }

    public FileUploadSuccessDTO(String fileId, String fileName, Long fileSize) {
        this.fileId = fileId;
        this.fileName = fileName;
        this.fileSize = fileSize;
    }


    public FileUploadSuccessDTO(String fileId, String fileName, Long fileSize, String fileUrl) {
        this.fileId = fileId;
        this.fileName = fileName;
        this.fileSize = fileSize;
        this.fileUrl = fileUrl;
    }

    public String getFileId() {
        return fileId == null ? "" : fileId.trim();
    }

    public void setFileId(String fileId) {
        this.fileId = fileId;
    }

    public String getFileName() {
        return fileName == null ? "" : fileName.trim();
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public Long getFileSize() {
        return fileSize == null ? 0 : fileSize;
    }

    public void setFileSize(Long fileSize) {
        this.fileSize = fileSize;
    }

    public String getFileUrl() {
        return fileUrl == null ? "" : fileUrl.trim();
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"fileId\":\"")
                .append(fileId).append('\"');
        sb.append(",\"fileName\":\"")
                .append(fileName).append('\"');
        sb.append(",\"fileSize\":")
                .append(fileSize);
        sb.append(",\"fileUrl\":\"")
                .append(fileUrl).append('\"');
        sb.append('}');
        return sb.toString();
    }
}
