package com.hai.enum_type;

import java.util.Objects;

/**
 * 订单推送类型
 * @author hurui
 */
public enum OrderPushType {
    type1(1 , "加油订单"),
    type2(2 , "充值订单"),
    type3(3 , "KFC订单"),
    type4(4 , "电影票订单"),
    type5(5 , "汇联通会员卡"),
    type6(6 , "汇联通卡券"),
    type7(7 , "汇联通会员充值订单"),
    type8(8 , "星巴克订单"),
    type9(9 , "会员充值订单"),
            ;

    private Integer  type;
    private String name;


    OrderPushType(int type , String name) {
        this.type = type;
        this.name = name;
    }

    public static String getNameByType(Integer type) {
        for (OrderPushType 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;
    }
}
