mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-24 00:55:35 +08:00
update Hello example Module
This commit is contained in:
@@ -5,11 +5,9 @@ namespace Module\Example;
|
|||||||
|
|
||||||
|
|
||||||
use Framework\Console;
|
use Framework\Console;
|
||||||
use Framework\ZMBuf;
|
|
||||||
use ZM\Annotation\CQ\CQCommand;
|
use ZM\Annotation\CQ\CQCommand;
|
||||||
use ZM\Annotation\Http\Controller;
|
use ZM\Annotation\Http\Controller;
|
||||||
use ZM\Annotation\Http\RequestMapping;
|
use ZM\Annotation\Http\RequestMapping;
|
||||||
use ZM\Annotation\Module\Closed;
|
|
||||||
use ZM\Annotation\Swoole\SwooleEventAt;
|
use ZM\Annotation\Swoole\SwooleEventAt;
|
||||||
use ZM\Connection\CQConnection;
|
use ZM\Connection\CQConnection;
|
||||||
use ZM\ModBase;
|
use ZM\ModBase;
|
||||||
@@ -48,4 +46,12 @@ class Hello extends ModBase
|
|||||||
public function pong(){
|
public function pong(){
|
||||||
$this->response->end("ping");
|
$this->response->end("ping");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @SwooleEventAt(type="open",rule="connectType:unknown")
|
||||||
|
*/
|
||||||
|
public function closeUnknownConn(){
|
||||||
|
Console::info("Unknown connection , I will close it.");
|
||||||
|
$this->connection->close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user