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]
[Route("api/[controller]")]
[ApiController]
public class AppointmentAreasController : ControllerBase
{
private readonly IAppointmentAreaService _appointmentAreaService;
public AppointmentAreasController(IAppointmentAreaService appointmentAreaService)
{
_appointmentAreaService = appointmentAreaService;
}
///
/// 保存
///
///
///
[HttpPost("save")]
public async Task SaveAsync(AppointmentAreaSaveRequest request)
{
await _appointmentAreaService.SaveAsync(request);
}
///
/// 预约区域分页
///
///
///
[HttpGet("page")]
public async Task> GetPageAsync([FromQuery] AppointmentAreaPageRequest request)
{
return await _appointmentAreaService.GetPageAsync(request);
}
///
/// 分配设备
///
///
[HttpPost("assign")]
[Transactional]
public async Task AssignAsync(AppointmentAreaAssignRequest request)
{
await _appointmentAreaService.AssignAsync(request);
}
///
/// 获取当前分配
///
///
///
[HttpGet("assignments")]
[Transactional]
public async Task> GetAssignmentsAsync(string customCode)
{
return await _appointmentAreaService.GetAssignmentsAsync(customCode);
}
}