Files
hyperf_service/app/Controller/Admin/CateringController.php
2025-03-13 15:08:26 +08:00

130 lines
3.6 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Controller\Admin;
use App\Middleware\Admin\JwtAuthMiddleware;
use App\Service\Admin\Catering\Meal\CycleListService as MealCycleListService;
use App\Service\Admin\Catering\Option\CompleteListService;
use App\Service\Admin\Catering\Option\CompletePrintService;
use App\Service\Admin\Catering\Option\CycleListService as OptionCycleListService;
use App\Service\Admin\Catering\Option\CateringService as OptionCateringService;
use App\Service\Admin\Catering\Option\PrintService;
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/catering")]
#[Middlewares([
JwtAuthMiddleware::class,
])]
class CateringController
{
#[RequestMapping(path: "meal/cycle_list", methods: "GET")]
#[Scene(scene: "meal_cycle_list")]
public function getMealCycleList()
{
return (new MealCycleListService)->handle();
}
#[RequestMapping(path: "option/cycle_list", methods: "GET")]
#[Scene(scene: "option_cycle_list")]
public function getOptionCycleList()
{
return(new OptionCycleListService)->handle();
}
#[RequestMapping(path: "meal/remain_count", methods: "GET")]
#[Scene(scene: "meal_remain_count")]
public function remainMealCateringCount()
{
return (new MealCycleListService)->remainCount();
}
#[RequestMapping(path: "option/remain_count", methods: "GET")]
#[Scene(scene: "option_remain_count")]
public function remainOptionCateringCount()
{
return (new OptionCycleListService)->remainCount();
}
public function getMealGoodsList()
{
return (new MealCycleListService)->skuList();
}
public function mealCatering()
{
}
/**
* 自选配餐
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[RequestMapping(path: "option/catering", methods: "POST")]
#[Scene(scene: "option_catering")]
public function optionCatering()
{
return (new OptionCateringService)->handle();
}
/**
* 自选是否打印
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[RequestMapping(path: "option/check_is_print", methods: "POST")]
#[Scene(scene: "option_check_is_print")]
public function optionCheckPrint()
{
return (new PrintService)->checkPrint();
}
/**
* 打印机/喷码机列表
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[RequestMapping(path: "option/print_list", methods: "GET")]
#[Scene(scene: "option_print_list")]
public function optionPrintList()
{
return (new PrintService)->handle();
}
/**
* 自选补打印列表
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[RequestMapping(path: "option/complete_list", methods: "GET")]
#[Scene(scene: "option_complete_list")]
public function completeList()
{
return (new CompleteListService)->handle();
}
/**
* 自选补打印
* @return array
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
#[RequestMapping(path: "option/complete_print", methods: "GET")]
#[Scene(scene: "option_complete_print")]
public function completePrint()
{
return (new CompletePrintService)->handle();
}
}