package com.crm.rely.backend.core.enums;

/**
 * 订阅，退订类型
 *
 * @author y
 * @create 2022/1/9
 */
public enum CustomSubscribeType {
    SUBSCRIBE(1, "SUBSCRIBE"),
    UNSUBSCRIBE(2, "UNSUBSCRIBE");


    private final Integer code;
    private final String desc;

    CustomSubscribeType(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static CustomSubscribeType matchCode(Integer code){
        for(CustomSubscribeType type : CustomSubscribeType.values()){
            if(type.getCode() ==  code){
                return type;
            }
        }
        return null;
    }

}
