This commit is contained in:
2020-12-29 16:32:19 +08:00
parent 982d64f9a2
commit d6c3c0b340
+24
View File
@@ -17,6 +17,10 @@ use HttpServer\Http\Response;
use HttpServer\Route\Router;
use HttpServer\Server;
use HttpServer\Service\Http;
use HttpServer\Service\Packet;
use HttpServer\Service\Receive;
use HttpServer\Service\Websocket;
use Kafka\Producer;
use Annotation\Annotation as SAnnotation;
use Snowflake\Cache\Redis;
@@ -357,6 +361,26 @@ abstract class BaseApplication extends Service
}
/**
* @return Server
* @throws ComponentException
*/
public function getServer(): Server
{
return $this->get('server');
}
/**
* @return Http|Packet|Receive|Websocket|null
* @throws ComponentException
*/
public function getService(): Packet|Websocket|Receive|Http|null
{
return $this->getServer()->getServer();
}
/**
* @return SAnnotation
* @throws ComponentException