73 lines
1.9 KiB
PHP
73 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller\Admin;
|
|
|
|
use App\Controller\AbstractController;
|
|
use App\Middleware\Admin\JwtAuthMiddleware;
|
|
use App\Service\Admin\Order\OrderInfoService;
|
|
use App\Service\Admin\Order\OrderListService;
|
|
use App\Service\Admin\Order\RefundService;
|
|
use Hyperf\HttpServer\Annotation\Controller;
|
|
use Hyperf\HttpServer\Annotation\Middlewares;
|
|
use Hyperf\HttpServer\Annotation\RequestMapping;
|
|
use Hyperf\Validation\Annotation\Scene;
|
|
use Psr\Container\ContainerExceptionInterface;
|
|
use Psr\Container\NotFoundExceptionInterface;
|
|
|
|
#[Controller(prefix: "admin/order")]
|
|
#[Middlewares([
|
|
JwtAuthMiddleware::class,
|
|
])]
|
|
class OrderController extends AbstractController
|
|
{
|
|
#[RequestMapping(path: "list", methods: "GET")]
|
|
#[Scene(scene: "list")]
|
|
public function list()
|
|
{
|
|
//todo
|
|
return (new OrderListService())->handle();
|
|
}
|
|
|
|
#[RequestMapping(path: "info", methods: "GET")]
|
|
#[Scene(scene: "info")]
|
|
public function info()
|
|
{
|
|
//todo
|
|
return (new OrderInfoService())->handle();
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
#[RequestMapping(path: "refund_all", methods: "POST")]
|
|
#[Scene(scene: "refund_all")]
|
|
public function refundAll()
|
|
{
|
|
return (new RefundService)->handle();
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
* @throws ContainerExceptionInterface
|
|
* @throws NotFoundExceptionInterface
|
|
*/
|
|
#[RequestMapping(path: "refund_partial", methods: "GET")]
|
|
#[Scene(scene: "refund_partial")]
|
|
public function refundPartial()
|
|
{
|
|
return (new RefundService)->refundPartial();
|
|
}
|
|
|
|
#[RequestMapping(path: "refund_batch", methods: "GET")]
|
|
#[Scene(scene: "refund_batch")]
|
|
public function batchRefund()
|
|
{
|
|
// todo
|
|
return (new RefundService)->refundBatch();
|
|
}
|
|
}
|