Перенёс Abstractions в другой namespace и небольшие улучшения
This commit is contained in:
13
SfeduSchedule.Abstractions/IPlugin.cs
Normal file
13
SfeduSchedule.Abstractions/IPlugin.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace SfeduSchedule.Abstractions;
|
||||
|
||||
// Базовый контракт плагина (общий для хоста и плагинов)
|
||||
public interface IPlugin
|
||||
{
|
||||
string Name { get; }
|
||||
|
||||
// Регистрация сервисов плагина в DI (выполняется до Build())
|
||||
void ConfigureServices(IServiceCollection services);
|
||||
|
||||
// Регистрация маршрутов (Minimal API) плагина после Build()
|
||||
void MapEndpoints(IEndpointRouteBuilder endpoints);
|
||||
}
|
||||
115
SfeduSchedule.Abstractions/ModeusScheduleRequestDTO.cs
Normal file
115
SfeduSchedule.Abstractions/ModeusScheduleRequestDTO.cs
Normal file
@@ -0,0 +1,115 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace SfeduSchedule.Abstractions;
|
||||
|
||||
/// <summary>
|
||||
/// DTO для запроса расписания в Modeus.
|
||||
/// </summary>
|
||||
public class ModeusScheduleRequest(
|
||||
int size,
|
||||
DateTime timeMin,
|
||||
DateTime timeMax,
|
||||
List<Guid>? roomId,
|
||||
List<Guid>? attendeePersonId,
|
||||
List<Guid>? courseUnitRealizationId,
|
||||
List<Guid>? cycleRealizationId,
|
||||
List<string>? specialtyCode,
|
||||
List<int>? learningStartYear,
|
||||
List<string>? profileName,
|
||||
List<Guid>? curriculumId,
|
||||
List<string>? typeId)
|
||||
{
|
||||
/// <summary>
|
||||
/// Количество элементов в ответе.
|
||||
/// </summary>
|
||||
[DefaultValue(10)]
|
||||
public int Size { get; set; } = size;
|
||||
|
||||
/// <summary>
|
||||
/// Начальная дата и время.
|
||||
/// </summary>
|
||||
public DateTime TimeMin { get; set; } = timeMin;
|
||||
|
||||
/// <summary>
|
||||
/// Конечная дата и время.
|
||||
/// </summary>
|
||||
public DateTime TimeMax { get; set; } = timeMax;
|
||||
|
||||
/// <summary>
|
||||
/// Список идентификаторов аудиторий. (Guid)
|
||||
/// </summary>
|
||||
public List<Guid>? RoomId { get; set; } = roomId;
|
||||
|
||||
/// <summary>
|
||||
/// Список идентификаторов участников.
|
||||
/// </summary>
|
||||
public List<Guid>? AttendeePersonId { get; set; } = attendeePersonId;
|
||||
|
||||
public List<Guid>? CourseUnitRealizationId { get; set; } = courseUnitRealizationId;
|
||||
public List<Guid>? CycleRealizationId { get; set; } = cycleRealizationId;
|
||||
|
||||
/// <summary>
|
||||
/// Список кодов специальностей.
|
||||
/// </summary>
|
||||
[DefaultValue(new string[] { "09.03.04" })]
|
||||
public List<string>? SpecialtyCode { get; set; } = specialtyCode;
|
||||
|
||||
/// <summary>
|
||||
/// Список годов начала обучения.
|
||||
/// </summary>
|
||||
[DefaultValue(new int[] { 2022, 2023, 2024, 2025 })]
|
||||
public List<int>? LearningStartYear { get; set; } = learningStartYear;
|
||||
|
||||
/// <summary>
|
||||
/// Список названий профилей подготовки.
|
||||
/// </summary>
|
||||
[DefaultValue(new string[] { "Методы и средства разработки программного обеспечения" })]
|
||||
public List<string>? ProfileName { get; set; } = profileName;
|
||||
|
||||
/// <summary>
|
||||
/// Список идентификаторов учебных планов.
|
||||
/// </summary>
|
||||
public List<Guid>? CurriculumId { get; set; } = curriculumId;
|
||||
|
||||
/// <summary>
|
||||
/// Список типов мероприятий.
|
||||
/// </summary>
|
||||
[DefaultValue(new string[] { "MID_CHECK", "CONS", "LAB", "LECT", "SEMI", "EVENT_OTHER", "SELF", "CUR_CHECK" })]
|
||||
public List<string>? TypeId { get; set; } = typeId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DTO для поиска аудиторий.
|
||||
/// </summary>
|
||||
public class RoomSearchRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Название аудитории.
|
||||
/// </summary>
|
||||
[DefaultValue("")]
|
||||
public string Name { get; set; } = "";
|
||||
|
||||
/// <summary>
|
||||
/// Сортировка.
|
||||
/// </summary>
|
||||
[DefaultValue("+building.name,+name")]
|
||||
public string Sort { get; set; } = "+building.name,+name";
|
||||
|
||||
/// <summary>
|
||||
/// Количество элементов в ответе.
|
||||
/// </summary>
|
||||
[DefaultValue(10)]
|
||||
public int Size { get; set; } = 10;
|
||||
|
||||
/// <summary>
|
||||
/// Номер страницы. (пагинация)
|
||||
/// </summary>
|
||||
[DefaultValue(0)]
|
||||
public int Page { get; set; } = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Исключать архивные аудитории. false = да, true = нет
|
||||
/// </summary>
|
||||
[DefaultValue(false)]
|
||||
public bool Deleted { get; set; } = false;
|
||||
}
|
||||
14
SfeduSchedule.Abstractions/SfeduSchedule.Abstractions.csproj
Normal file
14
SfeduSchedule.Abstractions/SfeduSchedule.Abstractions.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<OutputType>Library</OutputType>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<NoWarn>$(NoWarn);CS1591;CS1573</NoWarn>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user