mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-30 01:46:18 +08:00
add system operator agent
This commit is contained in:
42
src/main/java/love/sola/netsupport/enums/Access.java
Normal file
42
src/main/java/love/sola/netsupport/enums/Access.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package love.sola.netsupport.enums;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import static love.sola.netsupport.config.Lang.lang;
|
||||
|
||||
/**
|
||||
* ***********************************************
|
||||
* Created by Sola on 2015/12/6.
|
||||
* Don't modify this source without my agreement
|
||||
* ***********************************************
|
||||
*/
|
||||
public class Access {
|
||||
|
||||
public static final int ROOT = 0;
|
||||
public static final int NOLOGIN = 9;
|
||||
|
||||
public static final Map<Integer, String> inverseMap = new HashMap<>();
|
||||
|
||||
static{
|
||||
System.out.println("Loading Access...");
|
||||
for (Field field : Access.class.getDeclaredFields()) {
|
||||
if (field.getType().isAssignableFrom(Integer.TYPE)) {
|
||||
try {
|
||||
inverseMap.put((Integer) field.get(null), field.getName());
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String getLocalized(int access) {
|
||||
if (inverseMap.containsKey(access)) {
|
||||
return lang("ACCESS_" + inverseMap.get(access));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user