58 lines
1.1 KiB
PHP
Raw Normal View History

2020-03-02 16:14:20 +08:00
<?php
namespace Module\TestMod;
use Framework\Console;
use ZM\Annotation\CQ\CQCommand;
use ZM\Annotation\CQ\CQNotice;
2020-03-08 16:40:04 +08:00
use ZM\Annotation\Http\Controller;
use ZM\Annotation\Http\RequestMapping;
2020-03-02 16:14:20 +08:00
use ZM\Annotation\Swoole\SwooleEventAt;
use ZM\Connection\CQConnection;
use ZM\ModBase;
/**
* Class CQTest
* @package Module\TestMod
2020-03-08 16:40:04 +08:00
* @Controller("/view/test2")
2020-03-02 16:14:20 +08:00
*/
class CQTest extends ModBase
{
/**
* @SwooleEventAt(type="open",rule="connectType:qq")
* @param CQConnection $conn
*/
public function onRobotConnect($conn){
Console::info("QQ robot: ".$conn->getQQ()." connected.");
}
/**
* @CQCommand("多命令a")
* @CQCommand(regexMatch="*是什么")
* @param $arg
* @return string
* @throws \ZM\Exception\DbException
*/
public function hello($arg) {
return "我也不知道".$arg[0]."是什么呀";
}
2020-03-08 16:40:04 +08:00
/**
* @RequestMapping("/ping")
*/
public function ping(){}
/**
* @RequestMapping("/pong")
*/
public function pong(){}
2020-03-02 16:14:20 +08:00
/**
* @CQNotice(notice_type="group_admin")
*/
public function onNotice(){
}
}