first commit
This commit is contained in:
1
Swoft_BackEndApi/app/Aspect/.pydio
Normal file
1
Swoft_BackEndApi/app/Aspect/.pydio
Normal file
@@ -0,0 +1 @@
|
||||
375adeb4-4191-4d9e-858f-42da9b876834
|
||||
34
Swoft_BackEndApi/app/Aspect/FailAspect.php
Normal file
34
Swoft_BackEndApi/app/Aspect/FailAspect.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Aspect;
|
||||
|
||||
use Swoft\Aop\Annotation\Mapping\AfterThrowing;
|
||||
use Swoft\Aop\Annotation\Mapping\Aspect;
|
||||
use Swoft\Aop\Annotation\Mapping\PointAnnotation;
|
||||
use Swoft\Bean\Annotation\Mapping\Inject;
|
||||
use App\Bean\ResponseBean;
|
||||
/**
|
||||
* @Aspect(order=1)
|
||||
* @PointAnnotation(
|
||||
* include={
|
||||
* Swoft\Http\Server\Annotation\Mapping\RequestMapping::class
|
||||
* }
|
||||
* )
|
||||
*/
|
||||
class FailAspect {
|
||||
|
||||
/**
|
||||
* @Inject("ResponseBean")
|
||||
*/
|
||||
protected $response;
|
||||
|
||||
/**
|
||||
* @param \Throwable $throwable
|
||||
* @return array
|
||||
* @AfterThrowing()
|
||||
*/
|
||||
public function FailError(\Throwable $throwable) {
|
||||
return $this->response->fail($throwable);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user