using System.ComponentModel.DataAnnotations;
using Dlhis.Basic.Appointment.Request;
using Dlhis.Basic.Appointment.Response;
using Dlhis.Basic.Appointment.Services;
using Kurisu.AspNetCore.DataAccess.Dto;
using Kurisu.AspNetCore.DataAccess.SqlSugar.Aop;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Basic.Appointment.Controllers;
///
/// 预约
///
[Authorize]
[ApiController]
[Route("api/[controller]")]
public class AppointmentsController : ControllerBase
{
private readonly IAppointmentService _appointmentService;
public AppointmentsController(IAppointmentService appointmentService)
{
_appointmentService = appointmentService;
}
///
/// 预约申请分页
///
///
///
[HttpGet("page")]
public async Task> GetPageAsync([FromQuery] AppointmentPageRequest request)
{
return await _appointmentService.GetPageAsync(request);
}
///
/// 获取预约明细
///
///
///
[HttpGet("details")]
public async Task> GetAppointmentDetailsByIdAsync(string no)
{
return await _appointmentService.GetAppointmentDetailsByIdAsync(no);
}
///
/// 确认到达
///
///
///
[AllowAnonymous]
[HttpPost("confirm")]
[Transactional]
[IgnoreTenant]
public async Task ConfirmAsync(AppointmentConfirmRequest request)
{
await _appointmentService.ConfirmAsync(request);
}
///
/// 根据身份证获取当天预约信息
///
///
///
[AllowAnonymous]
[HttpGet("today")]
public async Task GetTodayByIdNoAsync(string idNo)
{
return await _appointmentService.GetTodayByIdNoAsync(idNo);
}
///
/// 根据身份证获取预约信息分页
///
///
///
[AllowAnonymous]
[HttpGet("idno/page")]
public async Task> GetRecordPageByIdNoAsync([FromQuery] AppointmentIdNoPageRequest request)
{
return await _appointmentService.GetRecordPageByIdNoAsync(request);
}
}