feat 生日券功能,自动上传消费数据,提醒访客到期
This commit is contained in:
102
Src/Dlhis.Canteen/Voucher/Controllers/EMealVoucherController.cs
Normal file
102
Src/Dlhis.Canteen/Voucher/Controllers/EMealVoucherController.cs
Normal file
@@ -0,0 +1,102 @@
|
||||
using Dlhis.Canteen.Order.Request;
|
||||
using Dlhis.Canteen.Order.Response;
|
||||
using Dlhis.Canteen.Voucher.Requests;
|
||||
using Dlhis.Canteen.Voucher.Response;
|
||||
using Dlhis.Canteen.Voucher.Services;
|
||||
using Kurisu.AspNetCore.DataAccess.Dto;
|
||||
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Dlhis.Canteen.Voucher.Controllers;
|
||||
|
||||
[Authorize]
|
||||
[Route("api/[controller]")]
|
||||
[ApiController]
|
||||
public class EMealVoucherController : ControllerBase
|
||||
{
|
||||
private readonly IEMealVoucherService _eMealVoucherService;
|
||||
|
||||
public EMealVoucherController(IEMealVoucherService eMealVoucherService)
|
||||
{
|
||||
_eMealVoucherService = eMealVoucherService;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 分页数据
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("page")]
|
||||
public async Task<Pagination<EMealVoucherPageResponse>> GetPageAsync([FromQuery] EMealVoucherPageRequest request)
|
||||
{
|
||||
return await _eMealVoucherService.GetPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取我的电子餐券申请
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("my")]
|
||||
public async Task<Pagination<EMealVoucherMyPageResponse>> GetMyEMealVoucherPageAsync([FromQuery] EMealVoucherPageRequest request)
|
||||
{
|
||||
return await _eMealVoucherService.GetMyEMealVoucherPageAsync(request);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查看电子餐券
|
||||
/// </summary>
|
||||
/// <param name="no"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("details")]
|
||||
public async Task<List<EMealVoucherDetailResponse>> GetDetailsByNoAsync(string no)
|
||||
{
|
||||
return await _eMealVoucherService.GetDetailsByNoAsync(no);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取url签名
|
||||
/// </summary>
|
||||
/// <param name="detailId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("signature")]
|
||||
public async Task<string> GetQrCodeSignatureAsync(long detailId)
|
||||
{
|
||||
return await _eMealVoucherService.GetQrCodeSignatureAsync(detailId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 刷新url签名
|
||||
/// </summary>
|
||||
/// <param name="detailId"></param>
|
||||
[HttpPost("signature/refresh")]
|
||||
public async Task RefreshSignatureAsync(long detailId)
|
||||
{
|
||||
await _eMealVoucherService.RefreshSignatureAsync(detailId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取二维码
|
||||
/// </summary>
|
||||
/// <param name="signature"></param>
|
||||
/// <returns></returns>
|
||||
[AllowAnonymous]
|
||||
[HttpGet("qrcode")]
|
||||
public async Task<string> GetQrCodeAsync(string signature)
|
||||
{
|
||||
return await _eMealVoucherService.GetQrCodeAsync(signature);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 餐券消费分页
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("balance/page")]
|
||||
[IgnoreTenant]
|
||||
public async Task<Pagination<BalanceRecordEMealVoucherResponse>> GetEMealVoucherPageAsync([FromQuery] BalanceRecordEMealVoucherPageRequest request)
|
||||
{
|
||||
return await _eMealVoucherService.GetEMealVoucherPageAsync(request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user