47 lines
1.5 KiB
C#
47 lines
1.5 KiB
C#
using Dlhis.Canteen.MealSupplementRecord.Request;
|
|
using Dlhis.Canteen.MealSupplementRecord.Response;
|
|
using Dlhis.Canteen.MealSupplementRecord.Services;
|
|
using Kurisu.Core.DataAccess.Dto;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
namespace Dlhis.Canteen.MealSupplementRecord.Controller;
|
|
|
|
/// <summary>
|
|
/// 原始餐补
|
|
/// </summary>
|
|
[Authorize]
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class MealSupplementsRecordController
|
|
{
|
|
private readonly IMealSupplementRecordService _mealSupplementRecordService;
|
|
|
|
public MealSupplementsRecordController(IMealSupplementRecordService mealSupplementRecordService)
|
|
{
|
|
_mealSupplementRecordService = mealSupplementRecordService;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 餐补分页
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("page")]
|
|
public async Task<Pagination<MealSupplementRecordResponse>> MealSupplementRecordPageAsync([FromQuery] MealSupplementRecordRequest request)
|
|
{
|
|
return await _mealSupplementRecordService.GetPageAsync(request);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取我的餐补数据
|
|
/// </summary>
|
|
/// <param name="request"></param>
|
|
/// <returns></returns>
|
|
[HttpGet("my")]
|
|
public async Task<MealSupplementRecordMyResponse> GetMyMealSupplementRecords([FromQuery] MealSupplementRecordMyRequest request)
|
|
{
|
|
return await _mealSupplementRecordService.GetMyMealSupplementRecords(request);
|
|
}
|
|
}
|