Merge branch 'dev' into branch-dev
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();
|
||||
}
|
||||
|
||||
}
|
||||
68
app/Controller/Api/DishController.php
Normal file
68
app/Controller/Api/DishController.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Middleware\Api\JwtAuthMiddleware;
|
||||
use App\Request\Api\DishRequest;
|
||||
use App\Service\Api\Material\DishService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
|
||||
#[Controller(prefix: 'api/dish')]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class DishController
|
||||
{
|
||||
/**
|
||||
* 菜品添加
|
||||
* @param DishRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "add", methods: "POST")]
|
||||
#[Scene(scene: "add")]
|
||||
public function dishAdd(dishRequest $request): array
|
||||
{
|
||||
return (new DishService())->add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜品修改
|
||||
* @param DishRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "edit", methods: "POST")]
|
||||
#[Scene(scene: "edit")]
|
||||
public function dishEdit(dishRequest $request): array
|
||||
{
|
||||
return (new DishService())->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜品列表
|
||||
* @param DishRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "list", methods: "GET")]
|
||||
#[Scene(scene: "list")]
|
||||
public function dishList(dishRequest $request): array
|
||||
{
|
||||
return (new DishService())->list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜品删除
|
||||
* @param DishRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "delete", methods: "POST")]
|
||||
#[Scene(scene: "delete")]
|
||||
public function dishDelete(dishRequest $request): array
|
||||
{
|
||||
return (new DishService())->delete();
|
||||
}
|
||||
}
|
||||
82
app/Controller/Api/MaterialController.php
Normal file
82
app/Controller/Api/MaterialController.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Middleware\Api\JwtAuthMiddleware;
|
||||
use App\Request\Api\MaterialRequest;
|
||||
use App\Service\Api\Material\MaterialService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
|
||||
#[Controller(prefix: 'api/material')]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class MaterialController
|
||||
{
|
||||
/**
|
||||
* 材料列表
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "list", methods: "GET")]
|
||||
#[Scene(scene: "material_list")]
|
||||
public function materialList(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->materialList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请材料
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "application", methods: "POST")]
|
||||
#[Scene(scene: "material_application")]
|
||||
public function materialApplication(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->materialApplication();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改申请材料
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "application_edit", methods: "POST")]
|
||||
#[Scene(scene: "application_edit")]
|
||||
public function materialApplicationEdit(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->applicationEdit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除申请材料
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "application_delete", methods: "POST")]
|
||||
#[Scene(scene: "application_delete")]
|
||||
public function materialApplicationDelete(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->applicationDelete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人申请材料列表
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "application_list", methods: "GET")]
|
||||
#[Scene(scene: "application_list")]
|
||||
public function applicationList(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->applicationList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user