feat:depot_recycle
This commit is contained in:
73
app/Controller/Api/DepotController.php
Normal file
73
app/Controller/Api/DepotController.php
Normal file
@@ -0,0 +1,73 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Middleware\Api\JwtAuthMiddleware;
|
||||
use App\Request\Admin\DepotRequest;
|
||||
use App\Service\Api\Depot\DepotService;
|
||||
use Exception;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
|
||||
#[Controller(prefix: 'api/depot')]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class DepotController
|
||||
{
|
||||
/**
|
||||
* 回收
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "depot_recycle", methods: "POST")]
|
||||
#[Scene(scene: "recycle")]
|
||||
public function depotRecycle(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->recycle();
|
||||
}
|
||||
|
||||
/**
|
||||
* 回收修改数量
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "recycle_update", methods: "POST")]
|
||||
#[Scene(scene: "recycle_update")]
|
||||
public function recycleUpdate(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->recycleUpdate();
|
||||
}
|
||||
|
||||
/**
|
||||
* 回收删除
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "recycle_delete", methods: "POST")]
|
||||
#[Scene(scene: "recycle_delete")]
|
||||
public function recycleDelete(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->recycleDelete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 回收列表
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "recycle_list", methods: "GET")]
|
||||
#[Scene(scene: "recycle_list")]
|
||||
public function recycleList(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->recycleList();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user