package com.qmth.jkserver.enums;

/**
 * token校验策略
 * @author tianjun
 *
 */
public enum TokenPolicy {

	NEED("需要校验token", 0),IGNORE("忽略token校验", 1);

    private String name;

    private int id;

    private TokenPolicy(String name, int id) {
        this.name = name;
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public int getId() {
        return id;
    }

    public static TokenPolicy findById(int id) {
        for (TokenPolicy status : TokenPolicy.values()) {
            if (status.id == id) {
                return status;
            }
        }
        return null;
    }

}
