Files
hyperf_service/app/Controller/Api/DepotController.php
LAPTOP-7SGDREK0\shiweijun 3f61e1e766 feat:depot_recycle
2025-02-10 16:11:26 +08:00

74 lines
1.8 KiB
PHP

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