调整架构,新增微信模块服务

This commit is contained in:
JaguarJack
2020-06-24 09:10:24 +08:00
parent 0e7453a6fe
commit 2d95212973
6 changed files with 109 additions and 16 deletions

View File

@@ -8,3 +8,32 @@
// +----------------------------------------------------------------------
// | Author: JaguarJack [ njphper@gmail.com ]
// +----------------------------------------------------------------------
namespace catchAdmin\wechat\controller;
use catcher\base\CatchController;
use catcher\library\WeChat;
use think\Request;
class Message extends CatchController
{
public function done(Request $request)
{
if ($request->isPost()) {
WeChat::officialAccount()->server->push(function ($message) {
switch ($message['MsgType']) {
case 'subscribe':
return '收到事件消息';
break;
case 'unsubscribe':
return '收到文字消息';
break;
case 'image':
default:
}
return '';
});
}
}
}