package com.qmth.boot.core.rateLimit.entity;

public enum RateLimitScope {

    //作用整个集群
    CLUSTER(""),

    //仅限当前实例
    INSTANCE("i");

    private String code;

    RateLimitScope(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public static RateLimitScope findByCode(char code) {
        return INSTANCE.getCode().equalsIgnoreCase(String.valueOf(code)) ? INSTANCE : null;
    }
}

