37 lines
931 B
PHP
37 lines
931 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Api;
|
|
|
|
use App\Amqp\Producer\RefundOrderProducer;
|
|
use App\Controller\AbstractController;
|
|
use App\Middleware\Api\JwtAuthMiddleware;
|
|
use App\Service\Api\Order\RefundOrderService;
|
|
use App\Service\Api\Pay\PlacePayService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middlewares;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Hyperf\Validation\Annotation\Scene;
|
|
|
|
#[Controller(prefix: 'api/pay')]
|
|
#[Middlewares([
|
|
JwtAuthMiddleware::class,
|
|
])]
|
|
class PayController extends AbstractController
|
|
{
|
|
#[RequestMapping(path: 'pay',methods: 'POST')]
|
|
#[Scene(scene: 'pay')]
|
|
public function pay()
|
|
{
|
|
return (new PlacePayService)->handle();
|
|
}
|
|
|
|
#[RequestMapping(path: 'refund',methods: 'POST')]
|
|
#[Scene(scene: 'refund')]
|
|
public function refund()
|
|
{
|
|
return (new RefundOrderService)->handle();
|
|
}
|
|
}
|