feat: write a dto in a separate project
This commit is contained in:
parent
511c0db3ee
commit
1b8c82949a
23
ApiDto/ApiDto.csproj
Normal file
23
ApiDto/ApiDto.csproj
Normal file
@ -0,0 +1,23 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>disable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Company>Winsomnia</Company>
|
||||
<Version>1.0.0-a0</Version>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<AssemblyName>Mirea.Api.Dto</AssemblyName>
|
||||
<RootNamespace>$(AssemblyName)</RootNamespace>
|
||||
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||
<DocumentationFile>ApiDtoDocs.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="ApiDtoDocs.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
22
ApiDto/Responses/CampusBasicInfoResponse.cs
Normal file
22
ApiDto/Responses/CampusBasicInfoResponse.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents basic information about a campus.
|
||||
/// </summary>
|
||||
public class CampusBasicInfoResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the campus.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the code name of the campus.
|
||||
/// </summary>
|
||||
public required string CodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the full name of the campus (optional).
|
||||
/// </summary>
|
||||
public string? FullName { get; set; }
|
||||
}
|
27
ApiDto/Responses/CampusDetailsResponse.cs
Normal file
27
ApiDto/Responses/CampusDetailsResponse.cs
Normal file
@ -0,0 +1,27 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents detailed information about a campus.
|
||||
/// </summary>
|
||||
public class CampusDetailsResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the campus.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the code name of the campus.
|
||||
/// </summary>
|
||||
public required string CodeName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the full name of the campus (optional).
|
||||
/// </summary>
|
||||
public string? FullName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the address of the campus (optional).
|
||||
/// </summary>
|
||||
public string? Address { get; set; }
|
||||
}
|
17
ApiDto/Responses/DisciplineResponse.cs
Normal file
17
ApiDto/Responses/DisciplineResponse.cs
Normal file
@ -0,0 +1,17 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents information about a discipline.
|
||||
/// </summary>
|
||||
public class DisciplineResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the discipline.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the discipline.
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
}
|
18
ApiDto/Responses/ErrorResponse.cs
Normal file
18
ApiDto/Responses/ErrorResponse.cs
Normal file
@ -0,0 +1,18 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// A class for providing information about an error
|
||||
/// </summary>
|
||||
public class ErrorResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// The text or translation code of the error. This field may not contain information in specific scenarios.
|
||||
/// For example, it might be empty for HTTP 204 responses where no content is returned or if the validation texts have not been configured.
|
||||
/// </summary>
|
||||
public required string Error { get; set; }
|
||||
/// <summary>
|
||||
/// In addition to returning the response code in the header, it is also duplicated in this field.
|
||||
/// Represents the HTTP response code.
|
||||
/// </summary>
|
||||
public required int Code { get; set; }
|
||||
}
|
32
ApiDto/Responses/FacultyDetailsResponse.cs
Normal file
32
ApiDto/Responses/FacultyDetailsResponse.cs
Normal file
@ -0,0 +1,32 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents detailed information about a faculty.
|
||||
/// </summary>
|
||||
public class FacultyDetailsResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the faculty.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the faculty.
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the campus to which the faculty belongs (optional).
|
||||
/// </summary>
|
||||
public int? CampusId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the campus to which the faculty belongs (optional).
|
||||
/// </summary>
|
||||
public string? CampusName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the code name of the campus to which the faculty belongs (optional).
|
||||
/// </summary>
|
||||
public string? CampusCode { get; set; }
|
||||
}
|
22
ApiDto/Responses/FacultyResponse.cs
Normal file
22
ApiDto/Responses/FacultyResponse.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents basic information about a faculty.
|
||||
/// </summary>
|
||||
public class FacultyResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the faculty.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the faculty.
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the campus to which the faculty belongs (optional).
|
||||
/// </summary>
|
||||
public int? CampusId { get; set; }
|
||||
}
|
27
ApiDto/Responses/GroupDetailsResponse.cs
Normal file
27
ApiDto/Responses/GroupDetailsResponse.cs
Normal file
@ -0,0 +1,27 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents detailed information about a group.
|
||||
/// </summary>
|
||||
public class GroupDetailsResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the group.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the group.
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the faculty to which the group belongs (optional).
|
||||
/// </summary>
|
||||
public int? FacultyId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the faculty to which the group belongs (optional).
|
||||
/// </summary>
|
||||
public string? FacultyName { get; set; }
|
||||
}
|
22
ApiDto/Responses/GroupResponse.cs
Normal file
22
ApiDto/Responses/GroupResponse.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents basic information about a group.
|
||||
/// </summary>
|
||||
public class GroupResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the group.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the group.
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the faculty to which the group belongs (optional).
|
||||
/// </summary>
|
||||
public int? FacultyId { get; set; }
|
||||
}
|
22
ApiDto/Responses/ProfessorResponse.cs
Normal file
22
ApiDto/Responses/ProfessorResponse.cs
Normal file
@ -0,0 +1,22 @@
|
||||
namespace Mirea.Api.Dto.Responses;
|
||||
|
||||
/// <summary>
|
||||
/// Represents information about a professor.
|
||||
/// </summary>
|
||||
public class ProfessorResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the unique identifier of the professor.
|
||||
/// </summary>
|
||||
public int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the professor.
|
||||
/// </summary>
|
||||
public required string Name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the alternate name of the professor (optional).
|
||||
/// </summary>
|
||||
public string? AltName { get; set; }
|
||||
}
|
Loading…
Reference in New Issue
Block a user