feat : sts
This commit is contained in:
58
app/Controller/Admin/PurchaseController.php
Normal file
58
app/Controller/Admin/PurchaseController.php
Normal file
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Controller\AbstractController;
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Service\Admin\Good\PurchaseService;
|
||||
use Exception;
|
||||
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/purchase')]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class PurchaseController extends AbstractController
|
||||
{
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
#[RequestMapping(path: "add", methods: "POST")]
|
||||
#[Scene(scene: "add")]
|
||||
public function add()
|
||||
{
|
||||
return (new PurchaseService)->add();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
#[RequestMapping(path: "del", methods: "GET")]
|
||||
#[Scene(scene: "del")]
|
||||
public function del()
|
||||
{
|
||||
return (new PurchaseService)->del();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "list", methods: "GET")]
|
||||
#[Scene(scene: "list")]
|
||||
public function list(): array
|
||||
{
|
||||
return (new PurchaseService)->handle();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user