Add controllers for the Get method #9

Merged
Wesser merged 33 commits from feat/controller-get into release/v1.0.0 2024-02-19 12:06:31 +03:00
2 changed files with 3 additions and 6 deletions
Showing only changes of commit 2b4065bbdf - Show all commits

View File

@ -19,7 +19,7 @@ namespace Mirea.Api.Endpoint.Controllers.V1
/// <returns>Basic information about campuses.</returns> /// <returns>Basic information about campuses.</returns>
[HttpGet] [HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
public async Task<ActionResult<List<CampusBasicInfoResponse>>> GetBasicInfo() public async Task<ActionResult<List<CampusBasicInfoResponse>>> Get()
{ {
var result = await mediator.Send(new GetCampusBasicInfoListQuery()); var result = await mediator.Send(new GetCampusBasicInfoListQuery());

View File

@ -23,9 +23,7 @@ namespace Mirea.Api.Endpoint.Controllers.V1
[HttpGet] [HttpGet]
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[BadRequestResponse] [BadRequestResponse]
public async Task<ActionResult<List<FacultyResponse>>> Get( public async Task<ActionResult<List<FacultyResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
[SwaggerDefault("0")][SwaggerSchema(Nullable = true)][FromQuery] int? page,
[SwaggerDefault("25")][SwaggerSchema(Nullable = true)][FromQuery] int? pageSize)
{ {
var result = await mediator.Send(new GetFacultyListQuery() var result = await mediator.Send(new GetFacultyListQuery()
{ {
@ -52,8 +50,7 @@ namespace Mirea.Api.Endpoint.Controllers.V1
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[BadRequestResponse] [BadRequestResponse]
[NotFoundResponse] [NotFoundResponse]
public async Task<ActionResult<FacultyDetailsResponse>> GetDetails( public async Task<ActionResult<FacultyDetailsResponse>> GetDetails(int id)
[SwaggerDefault("1")] int id)
{ {
var result = await mediator.Send(new GetFacultyInfoQuery() var result = await mediator.Send(new GetFacultyInfoQuery()
{ {