package com.qmth.file.enums;

/**
 * 用户角色
 * @author tianjun
 *
 */
public enum UserRole {

    ADMIN("管理员", 0),SUPER_ADMIN("超级管理员", 1);

    private String name;

    private int id;

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

    public String getName() {
        return name;
    }

    public int getId() {
        return id;
    }

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

}
