mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-30 09:56:18 +08:00
@@ -33,43 +33,43 @@ import static love.sola.netsupport.config.Lang.lang;
|
||||
*/
|
||||
public enum Command {
|
||||
|
||||
REGISTER(0, RegisterHandler.class),
|
||||
QUERY(1, QueryHandler.class),
|
||||
SUBMIT(2, SubmitHandler.class),
|
||||
CANCEL(3, CancelHandler.class),
|
||||
PROFILE(4, ProfileHandler.class),
|
||||
LOGIN(10, LoginHandler.class),
|
||||
OPERATOR_INFO(11, OperatorInfoHandler.class),
|
||||
SIGN(12, SignHandler.class), //FIXME
|
||||
;
|
||||
REGISTER(0, RegisterHandler.class),
|
||||
QUERY(1, QueryHandler.class),
|
||||
SUBMIT(2, SubmitHandler.class),
|
||||
CANCEL(3, CancelHandler.class),
|
||||
PROFILE(4, ProfileHandler.class),
|
||||
LOGIN(10, LoginHandler.class),
|
||||
OPERATOR_INFO(11, OperatorInfoHandler.class),
|
||||
SIGN(12, SignHandler.class), //FIXME
|
||||
;
|
||||
|
||||
private static final Map<Integer, Command> ID_MAP = new HashMap<>();
|
||||
private static final Map<Integer, Command> ID_MAP = new HashMap<>();
|
||||
|
||||
static {
|
||||
for (Command type : values()) {
|
||||
if (type.id >= 0) {
|
||||
ID_MAP.put(type.id, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
static {
|
||||
for (Command type : values()) {
|
||||
if (type.id >= 0) {
|
||||
ID_MAP.put(type.id, type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final String regex;
|
||||
public final Class<? extends WxMpMessageHandler> handler;
|
||||
public final int id;
|
||||
public final String regex;
|
||||
public final Class<? extends WxMpMessageHandler> handler;
|
||||
public final int id;
|
||||
|
||||
Command(int id, Class<? extends WxMpMessageHandler> handler) {
|
||||
this.id = id;
|
||||
this.regex = lang("REGEX_" + name());
|
||||
this.handler = handler;
|
||||
}
|
||||
Command(int id, Class<? extends WxMpMessageHandler> handler) {
|
||||
this.id = id;
|
||||
this.regex = lang("REGEX_" + name());
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public static Command fromId(int id) {
|
||||
return ID_MAP.get(id);
|
||||
}
|
||||
public static Command fromId(int id) {
|
||||
return ID_MAP.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name();
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return name();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user