package com.jxy.order.enums;

/**
 * @Description 币价查询范围条件
 * @Date 2022/5/20 11:15
 * @Author 杜懿
 */
public enum BasePrice {

    MONTHLY_USER(0,10),
    ANNUAL_USER(1,100),
    VIP_ANNUAL_USER(2,500);

    private final int code;
    private final double price;

    BasePrice(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 (BasePrice b : BasePrice.values()) {
            if(b.getCode()==code){
                return b.getPrice();
            }
        }
        return 0.0;
    }


}
