改名
This commit is contained in:
@@ -10,13 +10,13 @@ use HttpServer\IInterface\Limits;
|
||||
use HttpServer\Route\Node;
|
||||
use ReflectionClass;
|
||||
use ReflectionException;
|
||||
use Snowflake\Abstracts\BaseAnnotation;
|
||||
use Snowflake\Annotation\Annotation;
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
* Class Annotation
|
||||
*/
|
||||
class Annotation extends \Snowflake\Annotation\Annotation
|
||||
class Http extends Annotation
|
||||
{
|
||||
|
||||
const HTTP_EVENT = 'http:event:';
|
||||
@@ -22,13 +22,6 @@ class Tcp extends Annotation
|
||||
|
||||
private string $Message = 'required|not empty';
|
||||
|
||||
|
||||
private string $Handshake;
|
||||
|
||||
|
||||
private string $Close;
|
||||
|
||||
|
||||
/**
|
||||
* @param $controller
|
||||
* @param $methodName
|
||||
|
||||
@@ -9,7 +9,7 @@ use Closure;
|
||||
use HttpServer\Http\Request;
|
||||
use Exception;
|
||||
use HttpServer\Application;
|
||||
use HttpServer\Route\Annotation\Annotation;
|
||||
use HttpServer\Route\Annotation\Http;
|
||||
use Snowflake\Core\JSON;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
@@ -208,9 +208,8 @@ class Node extends Application
|
||||
throw new Exception('method ' . $action . ' not exists at ' . $controller . '.');
|
||||
}
|
||||
|
||||
/** @var Annotation $annotation */
|
||||
$annotation = Snowflake::app()->annotation->get('http');
|
||||
if (!empty($annotations = $annotation->getAnnotation(Annotation::class))) {
|
||||
$annotation = Snowflake::app()->annotation->http;
|
||||
if (!empty($annotations = $annotation->getAnnotation(Http::class))) {
|
||||
$annotation->read($this, $reflect, $action, $annotations);
|
||||
}
|
||||
return [$reflect->newInstance(), $action];
|
||||
|
||||
@@ -10,7 +10,7 @@ use HttpServer\Http\Context;
|
||||
use HttpServer\Http\Request;
|
||||
use HttpServer\IInterface\RouterInterface;
|
||||
use HttpServer\Application;
|
||||
use HttpServer\Route\Annotation\Annotation;
|
||||
use HttpServer\Route\Annotation\Http;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Core\JSON;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
@@ -580,11 +580,10 @@ class Router extends Application implements RouterInterface
|
||||
{
|
||||
$prefix = APP_PATH . 'app/Http/';
|
||||
|
||||
/** @var Annotation $annotation */
|
||||
/** @var Http $annotation */
|
||||
$annotation = Snowflake::app()->annotation;
|
||||
$annotation->register('http', Annotation::class);
|
||||
|
||||
$annotation = $annotation->get('http');
|
||||
$annotation = $annotation->http;
|
||||
$annotation->registration_notes($prefix . 'Interceptor', 'App\Http\Interceptor');
|
||||
$annotation->registration_notes($prefix . 'Limits', 'App\Http\Limits');
|
||||
$annotation->registration_notes($prefix . 'Middleware', 'App\Http\Middleware');
|
||||
|
||||
Reference in New Issue
Block a user