改名
This commit is contained in:
@@ -12,6 +12,7 @@ use HttpServer\Route\Annotation\Annotation;
|
||||
use Snowflake\Core\JSON;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Snowflake;
|
||||
use Swoole\Coroutine;
|
||||
|
||||
/**
|
||||
* Class Node
|
||||
@@ -86,6 +87,19 @@ class Node extends Application
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $response
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function afterDispatch($response)
|
||||
{
|
||||
return Coroutine::create(function ($response) {
|
||||
$callback = Reduce::after($this->_after);
|
||||
$callback(\request(), $response);
|
||||
}, [$response]);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -95,6 +109,24 @@ class Node extends Application
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function getAfters()
|
||||
{
|
||||
return $this->_after;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasAfter()
|
||||
{
|
||||
return count($this->_after) > 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user