Files
jinko.yikatong/Src/Dlhis.Visitor/Appointment/Controllers/ApponintmentAreasController.cs
2024-04-20 15:30:27 +08:00

69 lines
2.2 KiB
C#

using Dlhis.Visitor.Appointment.Request;
using Dlhis.Visitor.Appointment.Response;
using Dlhis.Visitor.Appointment.Services;
using Kurisu.Core.DataAccess.Dto;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace Dlhis.Visitor.Appointment.Controllers;
/// <summary>
/// 预约区域
/// </summary>
[Authorize]
[Route("api/[controller]")]
[ApiController]
public class ApponintmentAreasController : ControllerBase
{
private readonly IApponintmentAreaService _apponintmentAreaService;
public ApponintmentAreasController(IApponintmentAreaService apponintmentAreaService)
{
_apponintmentAreaService = apponintmentAreaService;
}
/// <summary>
/// 预约区域
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpGet("page")]
public async Task<Pagination<ApponintmentAreaPageResponse>> GetPageAsync([FromQuery] PageDto request)
{
return await _apponintmentAreaService.GetPageAsync(request);
}
/// <summary>
/// 保存
/// </summary>
/// <param name="request"></param>
/// <returns></returns>
[HttpPost("save")]
public async Task SaveAsync(AppointmentAreaSaveRequest request)
{
await _apponintmentAreaService.SaveAsync(request);
}
/// <summary>
/// 删除
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpDelete("{id}")]
public async Task DeleteAsync(long id)
{
await _apponintmentAreaService.DeleteAsync(id);
}
/// <summary>
/// 分配设备
/// </summary>
/// <returns></returns>
[HttpPost("assign")]
public async Task AssignAsync(AppointmentAreaAssignRequest request)
{
await _apponintmentAreaService.AssignAsync(request);
}
}