cortana ready

This commit is contained in:
Sola
2015-12-29 12:10:57 +08:00
parent 4c837b36ae
commit 83ef97609d
3 changed files with 59 additions and 0 deletions

View 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;
}
}

View File

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

View File