# AlertRuleEnum.java

    package cloud.wconnect.rateshop.cons.rateshop;

    import lombok.AllArgsConstructor;
    import lombok.Getter;

    /**
     * alert rule 枚举类
     *
     * @author lichen
     * @date 2023/6/7
     */
    @AllArgsConstructor
    @Getter
    public enum AlertRuleEnum {

        //酒店 最低价格变化幅度超过***
        PRICE_CHANGE(1, "Price Change"),
        //酒店 sold out
        SOLD_OUT(2, "Sold Out"),
        //市场趋势 级别 发生变化
        MARKET_DEMAND(3, "Market Demand"),
        //iwc级别发生变化
        IWC_LEVEL_CHANGE(4, "IWC Level Change");

        private int code;

        private String desc;

        /**
         * 获取描述
         *
         * @param code 码值
         * @return java.lang.String
         * @author lichen
         * @date 2023/6/10
         */
        public static String getDesc(int code) {
            for (AlertRuleEnum alertRuleEnum : AlertRuleEnum.values()) {
                if (alertRuleEnum.getCode() == code) {
                    return alertRuleEnum.getDesc();
                }
            }
            return "";
        }

    }