mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-30 09:56:18 +08:00
wechat query command
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
package love.sola.netsupport.wechat;
|
||||
|
||||
import love.sola.netsupport.wechat.handler.QueryHandler;
|
||||
import love.sola.netsupport.wechat.handler.RegisterHandler;
|
||||
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -13,9 +17,9 @@ import static love.sola.netsupport.config.Lang.lang;
|
||||
*/
|
||||
public enum Command {
|
||||
|
||||
REGISTER(0, ".*"),
|
||||
QUERY(1, "Query"),
|
||||
SUBMIT(1, "Submit"),
|
||||
REGISTER(0, RegisterHandler.class),
|
||||
QUERY(1, QueryHandler.class),
|
||||
SUBMIT(2, null),
|
||||
;
|
||||
|
||||
private static final Map<Integer, Command> ID_MAP = new HashMap<>();
|
||||
@@ -30,12 +34,14 @@ public enum Command {
|
||||
|
||||
public final String name;
|
||||
public final String regex;
|
||||
public final Class<? extends WxMpMessageHandler> handler;
|
||||
public final int id;
|
||||
|
||||
Command(int id, String regex) {
|
||||
Command(int id, Class<? extends WxMpMessageHandler> handler) {
|
||||
this.name = lang("CMD_" + name());
|
||||
this.id = id;
|
||||
this.regex = regex;
|
||||
this.regex = lang("REGEX_" + name());
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public static Command fromId(int id) {
|
||||
|
||||
Reference in New Issue
Block a user