feat : sts

This commit is contained in:
2025-04-14 17:46:06 +08:00
parent 217ed0c240
commit e996536bf5
10 changed files with 491 additions and 7 deletions

View 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();
}
}