oauth2 v2 update

This commit is contained in:
Sola
2016-03-27 03:12:58 +08:00
parent 910bdca8a8
commit 850e45a2d8
48 changed files with 799 additions and 422 deletions

View File

@@ -1,6 +1,9 @@
package love.sola.netsupport.wechat;
import love.sola.netsupport.auth.OAuth2;
import love.sola.netsupport.auth.OAuth2Handler;
import love.sola.netsupport.config.Settings;
import love.sola.netsupport.sql.SQLCore;
import love.sola.netsupport.wechat.handler.RegisterHandler;
import love.sola.netsupport.wechat.handler.SubscribeHandler;
import love.sola.netsupport.wechat.matcher.CheckSpamMatcher;
@@ -86,6 +89,9 @@ public class WxMpServlet extends HttpServlet {
WxMpMessageHandler handler = c.handler.newInstance();
router.rule().async(false).msgType(WxConsts.XML_MSG_TEXT).rContent(c.regex).handler(handler).end();
router.rule().async(false).msgType(WxConsts.XML_MSG_EVENT).event(WxConsts.EVT_CLICK).eventKey(c.name()).handler(handler).end();
if (handler instanceof OAuth2Handler) {
OAuth2.registerOAuth2Handler(c.name(), (OAuth2Handler) handler);
}
}
}
@@ -153,4 +159,8 @@ public class WxMpServlet extends HttpServlet {
doPost(req, resp);
}
@Override
public void destroy() {
SQLCore.destroy();
}
}