Compare commits
2 Commits
428ee1d388
...
f771dafcde
Author | SHA1 | Date | |
---|---|---|---|
f771dafcde | |||
7e1df403e2 |
@@ -12,25 +12,6 @@ namespace SfeduSchedule.Controllers
|
||||
public class ScheduleController(ModeusService modeusService, ILogger<ScheduleController> logger) : ControllerBase
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Получить расписание для указанных пользователей.
|
||||
/// </summary>
|
||||
/// <param name="attendeePersonId">Список GUID пользователей, для которых запрашивается расписание.</param>
|
||||
/// <returns>Список событий расписания.</returns>
|
||||
/// <response code="200">Возвращает расписание</response>
|
||||
/// <response code="429">Слишком много запросов</response>
|
||||
[HttpGet]
|
||||
[Route("test")]
|
||||
public async Task<IActionResult> Get([FromQuery] List<Guid> attendeePersonId, [FromQuery] DateTime? startDate, [FromQuery] DateTime? endDate)
|
||||
{
|
||||
startDate ??= DateTime.UtcNow;
|
||||
endDate ??= DateTime.UtcNow.AddDays(20);
|
||||
|
||||
var msr = new ModeusScheduleRequest(500, (DateTime)startDate, (DateTime)endDate, attendeePersonId);
|
||||
var schedule = await modeusService.GetScheduleAsync(msr);
|
||||
return Ok(schedule);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Получить расписание по пользовательскому запросу.
|
||||
/// </summary>
|
||||
|
@@ -2,12 +2,14 @@ using System.ComponentModel;
|
||||
|
||||
namespace SfeduSchedule
|
||||
{
|
||||
public class ModeusScheduleRequest(int size, DateTime timeMin, DateTime timeMax, List<Guid> attendeePersonId)
|
||||
public class ModeusScheduleRequest(int size, DateTime timeMin, DateTime timeMax, List<Guid>? attendeePersonId, List<Guid>? roomId)
|
||||
{
|
||||
[DefaultValue(10)]
|
||||
public int Size { get; set; } = size;
|
||||
public DateTime TimeMin { get; set; } = timeMin;
|
||||
public DateTime TimeMax { get; set; } = timeMax;
|
||||
public List<Guid> AttendeePersonId { get; set; } = attendeePersonId;
|
||||
public List<Guid>? AttendeePersonId { get; set; } = attendeePersonId;
|
||||
public List<Guid>? RoomId { get; set; } = roomId;
|
||||
}
|
||||
|
||||
public class RoomSearchRequest
|
||||
|
Reference in New Issue
Block a user