package com.hai.order.type;

import java.util.Objects;

/**
 * 订单退款状态
 * @className: OrderRefundStatus
 * @author: HuRui
 * @date: 2022/9/1
 **/
public enum OrderRefundStatus {
    STATUS1(1, "退款中"),
    STATUS2(2, "退款成功"),
    STATUS3(3, "退款失败"),
    ;

    private Integer number;

    private String name;

    OrderRefundStatus(int number, String name) {
        this.number = number;
        this.name = name;
    }

    /**
     * 根据类型查询数据
     * @param type
     * @return
     */
    public static OrderRefundStatus getDataByType(Integer type) {
        for (OrderRefundStatus ele : values()) {
            if(Objects.equals(type,ele.getNumber())) return ele;
        }
        return null;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
