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 WmsInResult<T> implements Serializable {


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

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

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

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

    public WmsInResult(String message, String instruction_no) {
        this.message = message;
        this.status = "200";
        this.instruction_no = instruction_no;
    }

    public WmsInResult(String status, String message, String instruction_no) {
        this.message = message;
        this.status = status;
        this.instruction_no = 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 getInstruction_no() {
        return instruction_no;
    }

    public void setInstruction_no(String instruction_no) {
        this.instruction_no = instruction_no;
    }

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