feat : refund
This commit is contained in:
@@ -4,7 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Controller\Api;
|
namespace App\Controller\Api;
|
||||||
|
|
||||||
use App\Amqp\Producer\RefundOrderProducer;
|
|
||||||
use App\Controller\AbstractController;
|
use App\Controller\AbstractController;
|
||||||
use App\Middleware\Api\JwtAuthMiddleware;
|
use App\Middleware\Api\JwtAuthMiddleware;
|
||||||
use App\Service\Api\Order\RefundOrderService;
|
use App\Service\Api\Order\RefundOrderService;
|
||||||
@@ -13,6 +12,8 @@ use Hyperf\HttpServer\Annotation\Controller;
|
|||||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||||
use Hyperf\Validation\Annotation\Scene;
|
use Hyperf\Validation\Annotation\Scene;
|
||||||
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
|
|
||||||
#[Controller(prefix: 'api/pay')]
|
#[Controller(prefix: 'api/pay')]
|
||||||
#[Middlewares([
|
#[Middlewares([
|
||||||
@@ -20,16 +21,26 @@ use Hyperf\Validation\Annotation\Scene;
|
|||||||
])]
|
])]
|
||||||
class PayController extends AbstractController
|
class PayController extends AbstractController
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
#[RequestMapping(path: 'pay',methods: 'POST')]
|
#[RequestMapping(path: 'pay',methods: 'POST')]
|
||||||
#[Scene(scene: 'pay')]
|
#[Scene(scene: 'pay')]
|
||||||
public function pay()
|
public function pay(): array
|
||||||
{
|
{
|
||||||
return (new PlacePayService)->handle();
|
return (new PlacePayService)->handle();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array
|
||||||
|
* @throws ContainerExceptionInterface
|
||||||
|
* @throws NotFoundExceptionInterface
|
||||||
|
*/
|
||||||
#[RequestMapping(path: 'refund',methods: 'POST')]
|
#[RequestMapping(path: 'refund',methods: 'POST')]
|
||||||
#[Scene(scene: 'refund')]
|
#[Scene(scene: 'refund')]
|
||||||
public function refund()
|
public function refund(): array
|
||||||
{
|
{
|
||||||
return (new RefundOrderService)->handle();
|
return (new RefundOrderService)->handle();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user