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


    @ApiModelProperty(value = "消息对象")
    private String message;
    @ApiModelProperty(value = "状态")
    private String status;
    @ApiModelProperty(value = "商品编码")
    private String sku_no;


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

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

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

    public WmsItemResult(String message, String sku_no) {
        this.message = message;
        this.status = "200";
        this.sku_no = sku_no;
    }

    public WmsItemResult(String status, String message, String sku_no) {
        this.message = message;
        this.status = status;
        this.sku_no = sku_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 getSku_no() {
        return sku_no;
    }

    public void setSku_no(String sku_no) {
        this.sku_no = sku_no;
    }

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