Merge branch 'dev' into branch-dev
This commit is contained in:
258
app/Controller/Admin/DepotController.php
Normal file
258
app/Controller/Admin/DepotController.php
Normal file
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Request\Admin\DepotRequest;
|
||||
use App\Service\Admin\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: 'admin/depot')]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class DepotController
|
||||
{
|
||||
|
||||
/**
|
||||
* 仓库列表
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "depot_list", methods: "GET")]
|
||||
#[Scene(scene: "depot_list")]
|
||||
public function list(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->depotList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加仓库
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "depot_add", methods: "POST")]
|
||||
#[Scene(scene: "depot_add")]
|
||||
public function add(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改仓库
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "depot_edit", methods: "POST")]
|
||||
#[Scene(scene: "depot_edit")]
|
||||
public function edit(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除仓库
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "depot_delete", methods: "GET")]
|
||||
#[Scene(scene: "depot_delete")]
|
||||
public function delete(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 采购入库
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "depot_purchase", methods: "POST")]
|
||||
#[Scene(scene: "purchase")]
|
||||
public function purchase(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->purchase();
|
||||
}
|
||||
|
||||
/**
|
||||
* 采购修改
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "depot_purchase_update", methods: "POST")]
|
||||
#[Scene(scene: "purchase_update")]
|
||||
public function purchaseUpdate(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->purchaseUpdate();
|
||||
}
|
||||
|
||||
/**
|
||||
* 采购退货
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "depot_purchase_back", methods: "POST")]
|
||||
#[Scene(scene: "purchase_back")]
|
||||
public function purchaseBack(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->purchaseBack();
|
||||
}
|
||||
|
||||
/**
|
||||
* 采购列表
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "purchase_list", methods: "GET")]
|
||||
#[Scene(scene: "purchase_list")]
|
||||
public function purchaseList(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->purchaseList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计采购额
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "purchase_statistics", methods: "GET")]
|
||||
#[Scene(scene: "purchase_statistics")]
|
||||
public function purchaseStatistics(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->purchaseStatistics();
|
||||
}
|
||||
|
||||
/**
|
||||
* 销售出库
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "depot_sale", methods: "POST")]
|
||||
#[Scene(scene: "sale")]
|
||||
public function depotSale(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->depotSale();
|
||||
}
|
||||
|
||||
/**
|
||||
* 销售出库数量修改
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "sale_update", methods: "POST")]
|
||||
#[Scene(scene: "sale_update")]
|
||||
public function saleUpdate(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->saleUpdate();
|
||||
}
|
||||
|
||||
/**
|
||||
* 销售出库删除
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
#[RequestMapping(path: "sale_delete", methods: "POST")]
|
||||
#[Scene(scene: "sale_delete")]
|
||||
public function saleDelete(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->saleDelete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 出库列表
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "sale_list", methods: "GET")]
|
||||
#[Scene(scene: "sale_list")]
|
||||
public function saleList(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->saleList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计销售额
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "sale_statistics", methods: "GET")]
|
||||
#[Scene(scene: "sale_statistics")]
|
||||
public function saleStatistics(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->saleStatistics();
|
||||
}
|
||||
|
||||
/**
|
||||
* 回收
|
||||
* @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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 回收审核
|
||||
* @param DepotRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "recycle_audit", methods: "POST")]
|
||||
#[Scene(scene: "recycle_audit")]
|
||||
public function recycleAudit(DepotRequest $request): array
|
||||
{
|
||||
return (new DepotService)->recycleAudit();
|
||||
}
|
||||
}
|
||||
33
app/Controller/Admin/DishController.php
Normal file
33
app/Controller/Admin/DishController.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Request\Admin\DishRequest;
|
||||
use App\Service\Admin\Material\DishService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
|
||||
#[Controller(prefix: 'admin/dish')]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class DishController
|
||||
{
|
||||
/**
|
||||
* @param DishRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "list", methods: "GET")]
|
||||
#[Scene(scene: "list")]
|
||||
public function list(DishRequest $request): array
|
||||
{
|
||||
return (new DishService)->dishList();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
81
app/Controller/Admin/MaterialCategoryController.php
Normal file
81
app/Controller/Admin/MaterialCategoryController.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Request\Admin\MaterialCategoryRequest;
|
||||
use App\Service\Admin\Material\MaterialCategoryService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
|
||||
#[Controller(prefix: 'admin/material_category')]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class MaterialCategoryController
|
||||
{
|
||||
|
||||
/**
|
||||
* 添加材料分类信息
|
||||
* @param MaterialCategoryRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "add", methods: "POST")]
|
||||
#[Scene(scene: "add")]
|
||||
public function add(MaterialCategoryRequest $request): array
|
||||
{
|
||||
return (new MaterialCategoryService)->add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改材料分类信息
|
||||
* @param MaterialCategoryRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "edit", methods: "POST")]
|
||||
#[Scene(scene: "edit")]
|
||||
public function edit(MaterialCategoryRequest $request): array
|
||||
{
|
||||
return (new MaterialCategoryService())->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除材料分类信息
|
||||
* @param MaterialCategoryRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "delete", methods: "GET")]
|
||||
#[Scene(scene: "delete")]
|
||||
public function delete(MaterialCategoryRequest $request): array
|
||||
{
|
||||
return (new MaterialCategoryService())->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询材料种类
|
||||
* @param MaterialCategoryRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "findById", methods: "GET")]
|
||||
#[Scene(scene: "material_category_info")]
|
||||
public function findById(MaterialCategoryRequest $request)
|
||||
{
|
||||
return (new MaterialCategoryService)->findById();
|
||||
}
|
||||
|
||||
/**
|
||||
* 材料钟类列表
|
||||
* @param MaterialCategoryRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "list", methods: "GET")]
|
||||
#[Scene(scene: "list")]
|
||||
public function getList(MaterialCategoryRequest $request)
|
||||
{
|
||||
return (new MaterialCategoryService)->list();
|
||||
}
|
||||
}
|
||||
106
app/Controller/Admin/MaterialController.php
Normal file
106
app/Controller/Admin/MaterialController.php
Normal file
@@ -0,0 +1,106 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Request\Admin\MaterialRequest;
|
||||
use App\Service\Admin\Material\MaterialService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
|
||||
#[Controller(prefix: 'admin/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: "add", methods: "POST")]
|
||||
#[Scene(scene: "material_add")]
|
||||
public function add(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService)->add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除材料信息
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "delete", methods: "GET")]
|
||||
#[Scene(scene: "material_delete")]
|
||||
public function delete(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->delete();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改材料信息
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "edit", methods: "POST")]
|
||||
#[Scene(scene: "material_edit")]
|
||||
public function edit(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 材料库存列表
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "materialStock_list", methods: "GET")]
|
||||
#[Scene(scene: "materialStock_list")]
|
||||
public function materialStockList(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->materialStockList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存信息
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "materialStock_edit", methods: "POST")]
|
||||
#[Scene(scene: "materialStock_edit")]
|
||||
public function materialStockEdit(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->materialStockEdit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 厨师成本列表
|
||||
* @param MaterialRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "chef_cost_list", methods: "GET")]
|
||||
#[Scene(scene: "chef_cost_list")]
|
||||
public function chefCostList(MaterialRequest $request): array
|
||||
{
|
||||
return (new MaterialService())->costListByChef();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
66
app/Controller/Admin/SupplierController.php
Normal file
66
app/Controller/Admin/SupplierController.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Request\Admin\SupplierRequest;
|
||||
use App\Service\Admin\Material\SupplierService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
|
||||
#[Controller(prefix: 'admin/supplier')]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class SupplierController
|
||||
{
|
||||
/**
|
||||
* 供应商列表
|
||||
* @param SupplierRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "list", methods: "GET")]
|
||||
#[Scene(scene: "list")]
|
||||
public function list(SupplierRequest $request): array
|
||||
{
|
||||
return (new SupplierService())->list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加供应商
|
||||
* @param SupplierRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "add", methods: "POST")]
|
||||
#[Scene(scene: "add")]
|
||||
public function add(SupplierRequest $request): array
|
||||
{
|
||||
return (new SupplierService)->add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "edit", methods: "POST")]
|
||||
#[Scene(scene: "edit")]
|
||||
public function edit(SupplierRequest $request): array
|
||||
{
|
||||
return (new SupplierService)->edit();
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "delete", methods: "GET")]
|
||||
#[Scene(scene: "delete")]
|
||||
public function delete(SupplierRequest $request): array
|
||||
{
|
||||
return (new SupplierService)->delete();
|
||||
}
|
||||
}
|
||||
45
app/Controller/Admin/WarehouseKeeperController.php
Normal file
45
app/Controller/Admin/WarehouseKeeperController.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Middleware\Admin\JwtAuthMiddleware;
|
||||
use App\Request\Admin\ChefRequest;
|
||||
use App\Request\Admin\WarehouseKeeperRequest;
|
||||
use App\Service\Admin\System\WarehouseService;
|
||||
use Hyperf\HttpServer\Annotation\Controller;
|
||||
use Hyperf\HttpServer\Annotation\Middlewares;
|
||||
use Hyperf\HttpServer\Annotation\RequestMapping;
|
||||
use Hyperf\Validation\Annotation\Scene;
|
||||
|
||||
#[Controller(prefix: "admin/warehouse_keeper")]
|
||||
#[Middlewares([
|
||||
JwtAuthMiddleware::class,
|
||||
])]
|
||||
class WarehouseKeeperController
|
||||
{
|
||||
/**
|
||||
* 仓管详细列表
|
||||
* @param WarehouseKeeperRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "warehouse_keeper_list", methods: "GET")]
|
||||
#[Scene(scene: "warehouse_keeper_list")]
|
||||
public function warehouseKeeperList(WarehouseKeeperRequest $request)
|
||||
{
|
||||
return (new WarehouseService())->warehouseList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置仓管数据
|
||||
* @param WarehouseKeeperRequest $request
|
||||
* @return array
|
||||
*/
|
||||
#[RequestMapping(path: "setting_warehouse_keeper", methods: "POST")]
|
||||
#[Scene(scene: "setting_warehouse_keeper")]
|
||||
public function settingWarehouseKeeper(WarehouseKeeperRequest $request)
|
||||
{
|
||||
return (new WarehouseService())->settingWarehouse();
|
||||
}
|
||||
}
|
||||
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