package com.microservices.file.domain.vo.response;

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

import java.io.Serializable;

/**
 * 取消上传响应
 *
 * @author microservices
 */
@Data
@ApiModel("取消上传响应")
public class CancelUploadResponseVo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("是否取消成功")
    private Boolean success;

    @ApiModelProperty("消息")
    private String message;

    /**
     * 创建成功响应
     */
    public static CancelUploadResponseVo success() {
        CancelUploadResponseVo response = new CancelUploadResponseVo();
        response.setSuccess(true);
        response.setMessage("上传已取消");
        return response;
    }

    /**
     * 创建失败响应
     */
    public static CancelUploadResponseVo failed(String message) {
        CancelUploadResponseVo response = new CancelUploadResponseVo();
        response.setSuccess(false);
        response.setMessage(message);
        return response;
    }
}
