package com.jxy.order.enums;

/**
 * @Description 角色id对应等级
 * @Date 2022/5/20 11:15
 * @Author 杜懿
 */
public enum UserRoleLevel {

    L1(0,10),
    L2(1,100),
    L3(2,500);

    private final int code;
    private final double price;

    UserRoleLevel(int code, double price)
    {
        this.code = code;
        this.price = price;
    }

    public int getCode()
    {
        return code;
    }

    public double getPrice()
    {
        return price;
    }

    public static double getPriceByCode(int code){
        for (UserRoleLevel b : UserRoleLevel.values()) {
            if(b.getCode()==code){
                return b.getPrice();
            }
        }
        return 0.0;
    }


}
