82 lines
2.2 KiB
C#
82 lines
2.2 KiB
C#
using Dlhis.Canteen.Order.Request;
|
|
using Dlhis.Canteen.Order.Response;
|
|
using Dlhis.Canteen.Order.Services;
|
|
using Kurisu.Core.DataAccess.Dto;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Dlhis.Canteen.Order.Controllers;
|
|
|
|
/// <summary>
|
|
/// 菜单菜品控制器
|
|
/// </summary>
|
|
[Authorize]
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class MenuDishesController : ControllerBase
|
|
{
|
|
private readonly IMenuDishesService _menuDishesService;
|
|
|
|
public MenuDishesController(IMenuDishesService menuDishesService)
|
|
{
|
|
_menuDishesService = menuDishesService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 菜单分页
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("pageMenu")]
|
|
public async Task<Pagination<GetMenuResponse>> GetMenuAsync([FromQuery]GetMenuRequest request)
|
|
{
|
|
return await _menuDishesService.GetMenuAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 菜单保存/更改
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("saveMenu")]
|
|
public async Task SaveMenuAsync(SaveMenuRequest request)
|
|
{
|
|
await _menuDishesService.SaveMenuAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 菜品分页
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("pageDishes")]
|
|
public async Task<Pagination<GetDishesResponse>> GetDishesAsync([FromQuery] GetDishesRequest request)
|
|
{
|
|
return await _menuDishesService.GetDishesAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 菜品保存/更改
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("saveDishes")]
|
|
public async Task SaveDishesAsync(SaveDishesRequest request)
|
|
{
|
|
await _menuDishesService.SaveDishesAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 配置每日菜单菜品及限售
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpPost("disposition")]
|
|
public async Task DispositionDishesAsync(DispositionDishesRequest request)
|
|
{
|
|
await _menuDishesService.DispositionDishesAsync(request);
|
|
}
|
|
}
|
|
|