package com.hai.enum_type;

import java.util.Objects;

/**
 * 订单状态
 * @author hurui
 */
public enum OrderStatusEnum {
    type1(1 , "待支付"),
    type2(2 , "已支付"),
    type3(3 , "已完成"),
    type4(4 , "已退款"),
    type5(5 , "已取消"),
    type6(6 , "退款中"),
    type7(7 , "拒绝退款"),
            ;

    private Integer type;
    private String name;

    OrderStatusEnum(int type , String name) {
        this.type = type;
        this.name = name;
    }
    public static String getNameByType(Integer type) {
        for (OrderStatusEnum ele : values()) {
            if(Objects.equals(type,ele.getType())) return ele.getName();
        }
        return null;
    }
    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

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