mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-03-18 13:14:52 +08:00
update start settings.
This commit is contained in:
parent
5f43cf4f00
commit
6f32d117d0
@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Module\TestMod;
|
||||
|
||||
|
||||
use Framework\Console;
|
||||
use ZM\Annotation\CQ\CQCommand;
|
||||
use ZM\Annotation\CQ\CQNotice;
|
||||
use ZM\Annotation\Http\Controller;
|
||||
use ZM\Annotation\Http\RequestMapping;
|
||||
use ZM\Annotation\Swoole\SwooleEventAt;
|
||||
use ZM\Connection\CQConnection;
|
||||
use ZM\ModBase;
|
||||
|
||||
/**
|
||||
* Class CQTest
|
||||
* @package Module\TestMod
|
||||
* @Controller("/view/test2")
|
||||
*/
|
||||
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]."是什么呀";
|
||||
}
|
||||
|
||||
/**
|
||||
* @RequestMapping("/ping")
|
||||
*/
|
||||
public function ping(){}
|
||||
|
||||
/**
|
||||
* @RequestMapping("/pong")
|
||||
*/
|
||||
public function pong(){}
|
||||
|
||||
/**
|
||||
* @CQNotice(notice_type="group_admin")
|
||||
*/
|
||||
public function onNotice(){
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace Module\TestMod;
|
||||
|
||||
use Framework\Console;
|
||||
use ZM\Annotation\Http\RequestMapping;
|
||||
use ZM\Annotation\Swoole\SwooleEventAt;
|
||||
use ZM\Connection\WSConnection;
|
||||
use ZM\ModBase;
|
||||
|
||||
/**
|
||||
* Class Hola
|
||||
* @package Module\TestMod
|
||||
* @noinspection PhpUnused
|
||||
*/
|
||||
class Hola extends ModBase
|
||||
{
|
||||
|
||||
/**
|
||||
* @SwooleEventAt(type="open",rule="connectType:unknown")
|
||||
* @param WSConnection $conn
|
||||
*/
|
||||
public function onUnknownConnect() {
|
||||
Console::warning("Unknown websocket has been shutdown.");
|
||||
Console::stackTrace();
|
||||
$this->connection->close();
|
||||
}
|
||||
|
||||
/** @RequestMapping("/ping") */
|
||||
public function ping(){
|
||||
return "OKK";
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user