using Dlhis.Canteen.MealSupplementRecord.Request;
using Dlhis.Canteen.MealSupplementRecord.Response;
using Dlhis.Canteen.MealSupplementRecord.Services;
using Kurisu.AspNetCore.DataAccess.Dto;
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Canteen.MealSupplementRecord.Controller;
///
/// 原始餐补
///
[Authorize]
[Route("api/[controller]")]
[ApiController]
public class MealSupplementsRecordController : ControllerBase
{
private readonly IMealSupplementRecordService _mealSupplementRecordService;
public MealSupplementsRecordController(IMealSupplementRecordService mealSupplementRecordService)
{
_mealSupplementRecordService = mealSupplementRecordService;
}
///
/// 餐补分页
///
///
///
[HttpGet("page")]
public async Task MealSupplementRecordPageAsync([FromQuery] MealSupplementRecordRequest request)
{
return await _mealSupplementRecordService.GetPageAsync(request);
}
///
/// 获取我的餐补数据
///
///
///
[IgnoreTenant]
[HttpGet("my")]
public async Task GetMyMealSupplementRecords([FromQuery] MealSupplementRecordMyRequest request)
{
return await _mealSupplementRecordService.GetMyMealSupplementRecords(request);
}
///
/// 期初餐补余额导入
///
[Authorize(Roles = "admin")]
[HttpPost("init/import")]
[Transactional]
public async Task InitImportAsync(List requests)
{
await _mealSupplementRecordService.InitImportAsync(requests);
}
}