mirror of
https://github.com/ZSCNetSupportDept/WechatTicketSystem.git
synced 2025-10-29 08:05:04 +08:00
cortana ready
This commit is contained in:
33
src/main/java/love/sola/netsupport/config/Cortana.java
Normal file
33
src/main/java/love/sola/netsupport/config/Cortana.java
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
package love.sola.netsupport.config;
|
||||||
|
|
||||||
|
import org.yaml.snakeyaml.Yaml;
|
||||||
|
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2015/12/29.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
public class Cortana {
|
||||||
|
|
||||||
|
|
||||||
|
public static List<Compiled> entries;
|
||||||
|
|
||||||
|
public static void load() {
|
||||||
|
InputStream in = Lang.class.getClassLoader().getResourceAsStream("cortana.yml");
|
||||||
|
Map<String, Object> root = (Map<String, Object>) new Yaml().load(in);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static class Compiled {
|
||||||
|
Pattern[] patterns;
|
||||||
|
String[] replies;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package love.sola.netsupport.wechat.handler;
|
||||||
|
|
||||||
|
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||||
|
import me.chanjar.weixin.common.session.WxSessionManager;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpMessageHandler;
|
||||||
|
import me.chanjar.weixin.mp.api.WxMpService;
|
||||||
|
import me.chanjar.weixin.mp.bean.WxMpXmlMessage;
|
||||||
|
import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ***********************************************
|
||||||
|
* Created by Sola on 2015/12/29.
|
||||||
|
* Don't modify this source without my agreement
|
||||||
|
* ***********************************************
|
||||||
|
*/
|
||||||
|
public class AutoReplyHandler implements WxMpMessageHandler {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public WxMpXmlOutMessage handle(WxMpXmlMessage wxMessage, Map<String, Object> context, WxMpService wxMpService, WxSessionManager sessionManager) throws WxErrorException {
|
||||||
|
//TODO auto reply
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
0
src/main/resources/cortana.yml
Normal file
0
src/main/resources/cortana.yml
Normal file
Reference in New Issue
Block a user