package com.prolog.eis.dto.result;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;

/**
 * @Author wangkang
 * @Description
 * @CreateTime 2021/7/5 10:20
 */
public class WmsOutResult<T> implements Serializable {


    @ApiModelProperty(value = "消息对象")
    private String message;
    @ApiModelProperty(value = "状态")
    private String status;
    @ApiModelProperty(value = "出库托盘号")
    private String shuttle_instruction_no;


    @Override
    public String toString() {
        return "WmsResult{" +
                ", message='" + message + '\'' +
                ", status='" + status + '\'' +
                ", shuttle_instruction_no='" + shuttle_instruction_no + '\'' +
                '}';
    }

    public static <T> WmsOutResult<T> success(String message, String shuttle_instruction_no) {
        return new WmsOutResult<T>(message,shuttle_instruction_no);
    }

    public static <T> WmsOutResult<T> error(String message, String shuttle_instruction_no) {
        return new WmsOutResult<T>("499", message,shuttle_instruction_no);
    }

    public WmsOutResult(String message, String shuttle_instruction_no) {
        this.message = message;
        this.status = "200";
        this.shuttle_instruction_no = shuttle_instruction_no;
    }

    public WmsOutResult(String status, String message, String shuttle_instruction_no) {
        this.message = message;
        this.status = status;
        this.shuttle_instruction_no = shuttle_instruction_no;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    public String getShuttle_instruction_no() {
        return shuttle_instruction_no;
    }

    public void setShuttle_instruction_no(String shuttle_instruction_no) {
        this.shuttle_instruction_no = shuttle_instruction_no;
    }

    public boolean isSuccess(){
        return this.status.equals("200");
    }
}
