format code

Signed-off-by: Sola <dev@sola.love>
This commit is contained in:
Sola
2017-12-15 08:57:51 +08:00
parent 529b36d9e3
commit 0bdcf031b5
69 changed files with 1988 additions and 1988 deletions

View File

@@ -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();
}
}