refactor: remove default produce 200 code
This commit is contained in:
parent
26dbf608b9
commit
f5739647b2
@ -1,6 +1,5 @@
|
|||||||
using Asp.Versioning;
|
using Asp.Versioning;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Campus.Queries.GetCampusBasicInfoList;
|
using Mirea.Api.DataAccess.Application.Cqrs.Campus.Queries.GetCampusBasicInfoList;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Campus.Queries.GetCampusDetails;
|
using Mirea.Api.DataAccess.Application.Cqrs.Campus.Queries.GetCampusDetails;
|
||||||
@ -21,7 +20,6 @@ public class CampusController(IMediator mediator) : BaseController
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Basic information about campuses.</returns>
|
/// <returns>Basic information about campuses.</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
public async Task<ActionResult<List<CampusBasicInfoResponse>>> Get()
|
public async Task<ActionResult<List<CampusBasicInfoResponse>>> Get()
|
||||||
{
|
{
|
||||||
var result = await mediator.Send(new GetCampusBasicInfoListQuery());
|
var result = await mediator.Send(new GetCampusBasicInfoListQuery());
|
||||||
@ -42,7 +40,6 @@ public class CampusController(IMediator mediator) : BaseController
|
|||||||
/// <param name="id">Campus ID.</param>
|
/// <param name="id">Campus ID.</param>
|
||||||
/// <returns>Details of the specified campus.</returns>
|
/// <returns>Details of the specified campus.</returns>
|
||||||
[HttpGet("{id:int}")]
|
[HttpGet("{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
public async Task<ActionResult<CampusDetailsResponse>> GetDetails(int id)
|
public async Task<ActionResult<CampusDetailsResponse>> GetDetails(int id)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using Asp.Versioning;
|
using Asp.Versioning;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Discipline.Queries.GetDisciplineDetails;
|
using Mirea.Api.DataAccess.Application.Cqrs.Discipline.Queries.GetDisciplineDetails;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Discipline.Queries.GetDisciplineList;
|
using Mirea.Api.DataAccess.Application.Cqrs.Discipline.Queries.GetDisciplineList;
|
||||||
@ -23,7 +22,6 @@ public class DisciplineController(IMediator mediator) : BaseController
|
|||||||
/// <param name="pageSize">Number of items per page.</param>
|
/// <param name="pageSize">Number of items per page.</param>
|
||||||
/// <returns>Paginated list of disciplines.</returns>
|
/// <returns>Paginated list of disciplines.</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
public async Task<ActionResult<List<DisciplineResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
|
public async Task<ActionResult<List<DisciplineResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
|
||||||
{
|
{
|
||||||
@ -48,7 +46,6 @@ public class DisciplineController(IMediator mediator) : BaseController
|
|||||||
/// <param name="id">Discipline ID.</param>
|
/// <param name="id">Discipline ID.</param>
|
||||||
/// <returns>Details of the specified discipline.</returns>
|
/// <returns>Details of the specified discipline.</returns>
|
||||||
[HttpGet("{id:int}")]
|
[HttpGet("{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
public async Task<ActionResult<DisciplineResponse>> GetDetails(int id)
|
public async Task<ActionResult<DisciplineResponse>> GetDetails(int id)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using Asp.Versioning;
|
using Asp.Versioning;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Faculty.Queries.GetFacultyDetails;
|
using Mirea.Api.DataAccess.Application.Cqrs.Faculty.Queries.GetFacultyDetails;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Faculty.Queries.GetFacultyList;
|
using Mirea.Api.DataAccess.Application.Cqrs.Faculty.Queries.GetFacultyList;
|
||||||
@ -23,7 +22,6 @@ public class FacultyController(IMediator mediator) : BaseController
|
|||||||
/// <param name="pageSize">Number of items per page.</param>
|
/// <param name="pageSize">Number of items per page.</param>
|
||||||
/// <returns>Paginated list of faculties.</returns>
|
/// <returns>Paginated list of faculties.</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
public async Task<ActionResult<List<FacultyResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
|
public async Task<ActionResult<List<FacultyResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
|
||||||
{
|
{
|
||||||
@ -49,7 +47,6 @@ public class FacultyController(IMediator mediator) : BaseController
|
|||||||
/// <param name="id">Faculty ID.</param>
|
/// <param name="id">Faculty ID.</param>
|
||||||
/// <returns>Details of the specified faculty.</returns>
|
/// <returns>Details of the specified faculty.</returns>
|
||||||
[HttpGet("{id:int}")]
|
[HttpGet("{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
public async Task<ActionResult<FacultyDetailsResponse>> GetDetails(int id)
|
public async Task<ActionResult<FacultyDetailsResponse>> GetDetails(int id)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using Asp.Versioning;
|
using Asp.Versioning;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Group.Queries.GetGroupDetails;
|
using Mirea.Api.DataAccess.Application.Cqrs.Group.Queries.GetGroupDetails;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Group.Queries.GetGroupList;
|
using Mirea.Api.DataAccess.Application.Cqrs.Group.Queries.GetGroupList;
|
||||||
@ -37,7 +36,6 @@ public class GroupController(IMediator mediator) : BaseController
|
|||||||
/// <param name="pageSize">The page size for pagination (optional).</param>
|
/// <param name="pageSize">The page size for pagination (optional).</param>
|
||||||
/// <returns>A list of groups.</returns>
|
/// <returns>A list of groups.</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
public async Task<ActionResult<List<GroupResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
|
public async Task<ActionResult<List<GroupResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
|
||||||
{
|
{
|
||||||
@ -64,7 +62,6 @@ public class GroupController(IMediator mediator) : BaseController
|
|||||||
/// <param name="id">The ID of the group to retrieve.</param>
|
/// <param name="id">The ID of the group to retrieve.</param>
|
||||||
/// <returns>Detailed information about the group.</returns>
|
/// <returns>Detailed information about the group.</returns>
|
||||||
[HttpGet("{id:int}")]
|
[HttpGet("{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
public async Task<ActionResult<GroupDetailsResponse>> GetDetails(int id)
|
public async Task<ActionResult<GroupDetailsResponse>> GetDetails(int id)
|
||||||
@ -90,7 +87,6 @@ public class GroupController(IMediator mediator) : BaseController
|
|||||||
/// <param name="id">The ID of the faculty.</param>
|
/// <param name="id">The ID of the faculty.</param>
|
||||||
/// <returns>A list of groups belonging to the specified faculty.</returns>
|
/// <returns>A list of groups belonging to the specified faculty.</returns>
|
||||||
[HttpGet("GetByFaculty/{id:int}")]
|
[HttpGet("GetByFaculty/{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
public async Task<ActionResult<List<GroupResponse>>> GetByFaculty(int id)
|
public async Task<ActionResult<List<GroupResponse>>> GetByFaculty(int id)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using Asp.Versioning;
|
using Asp.Versioning;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.LectureHall.Queries.GetLectureHallDetails;
|
using Mirea.Api.DataAccess.Application.Cqrs.LectureHall.Queries.GetLectureHallDetails;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.LectureHall.Queries.GetLectureHallList;
|
using Mirea.Api.DataAccess.Application.Cqrs.LectureHall.Queries.GetLectureHallList;
|
||||||
@ -21,7 +20,6 @@ public class LectureHallController(IMediator mediator) : BaseController
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>A list of lecture halls.</returns>
|
/// <returns>A list of lecture halls.</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
public async Task<ActionResult<List<LectureHallResponse>>> Get()
|
public async Task<ActionResult<List<LectureHallResponse>>> Get()
|
||||||
{
|
{
|
||||||
var result = await mediator.Send(new GetLectureHallListQuery());
|
var result = await mediator.Send(new GetLectureHallListQuery());
|
||||||
@ -42,7 +40,6 @@ public class LectureHallController(IMediator mediator) : BaseController
|
|||||||
/// <param name="id">The ID of the lecture hall to retrieve.</param>
|
/// <param name="id">The ID of the lecture hall to retrieve.</param>
|
||||||
/// <returns>The details of the specified lecture hall.</returns>
|
/// <returns>The details of the specified lecture hall.</returns>
|
||||||
[HttpGet("{id:int}")]
|
[HttpGet("{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
public async Task<ActionResult<LectureHallDetailsResponse>> GetDetails(int id)
|
public async Task<ActionResult<LectureHallDetailsResponse>> GetDetails(int id)
|
||||||
@ -68,7 +65,6 @@ public class LectureHallController(IMediator mediator) : BaseController
|
|||||||
/// <param name="id">The ID of the campus.</param>
|
/// <param name="id">The ID of the campus.</param>
|
||||||
/// <returns>A list of lecture halls in the specified campus.</returns>
|
/// <returns>A list of lecture halls in the specified campus.</returns>
|
||||||
[HttpGet("GetByCampus/{id:int}")]
|
[HttpGet("GetByCampus/{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
public async Task<ActionResult<List<LectureHallResponse>>> GetByCampus(int id)
|
public async Task<ActionResult<List<LectureHallResponse>>> GetByCampus(int id)
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
using Asp.Versioning;
|
using Asp.Versioning;
|
||||||
using MediatR;
|
using MediatR;
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Professor.Queries.GetProfessorDetails;
|
using Mirea.Api.DataAccess.Application.Cqrs.Professor.Queries.GetProfessorDetails;
|
||||||
using Mirea.Api.DataAccess.Application.Cqrs.Professor.Queries.GetProfessorList;
|
using Mirea.Api.DataAccess.Application.Cqrs.Professor.Queries.GetProfessorList;
|
||||||
@ -23,7 +22,6 @@ public class ProfessorController(IMediator mediator) : BaseController
|
|||||||
/// <param name="pageSize">The page size for pagination (optional).</param>
|
/// <param name="pageSize">The page size for pagination (optional).</param>
|
||||||
/// <returns>A list of professors.</returns>
|
/// <returns>A list of professors.</returns>
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
public async Task<ActionResult<List<ProfessorResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
|
public async Task<ActionResult<List<ProfessorResponse>>> Get([FromQuery] int? page, [FromQuery] int? pageSize)
|
||||||
{
|
{
|
||||||
@ -49,7 +47,6 @@ public class ProfessorController(IMediator mediator) : BaseController
|
|||||||
/// <param name="id">The ID of the professor to retrieve.</param>
|
/// <param name="id">The ID of the professor to retrieve.</param>
|
||||||
/// <returns>Detailed information about the professor.</returns>
|
/// <returns>Detailed information about the professor.</returns>
|
||||||
[HttpGet("{id:int}")]
|
[HttpGet("{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
public async Task<ActionResult<ProfessorResponse>> GetDetails(int id)
|
public async Task<ActionResult<ProfessorResponse>> GetDetails(int id)
|
||||||
|
@ -35,10 +35,8 @@ public class ScheduleController(IMediator mediator, IOptionsSnapshot<GeneralConf
|
|||||||
/// <param name="request">The request object containing filter criteria.</param>
|
/// <param name="request">The request object containing filter criteria.</param>
|
||||||
/// <returns>A list of schedules matching the filter criteria.</returns>
|
/// <returns>A list of schedules matching the filter criteria.</returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
|
||||||
public async Task<ActionResult<List<ScheduleResponse>>> Get([FromBody] ScheduleRequest request)
|
public async Task<ActionResult<List<ScheduleResponse>>> Get([FromBody] ScheduleRequest request)
|
||||||
{
|
{
|
||||||
if ((request.Groups == null || request.Groups.Length == 0) &&
|
if ((request.Groups == null || request.Groups.Length == 0) &&
|
||||||
@ -100,7 +98,6 @@ public class ScheduleController(IMediator mediator, IOptionsSnapshot<GeneralConf
|
|||||||
/// <param name="lectureHalls">An array of lecture hall IDs.</param>
|
/// <param name="lectureHalls">An array of lecture hall IDs.</param>
|
||||||
/// <returns>A response containing schedules for the specified group.</returns>
|
/// <returns>A response containing schedules for the specified group.</returns>
|
||||||
[HttpGet("GetByGroup/{id:int}")]
|
[HttpGet("GetByGroup/{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
@ -128,7 +125,6 @@ public class ScheduleController(IMediator mediator, IOptionsSnapshot<GeneralConf
|
|||||||
/// <param name="lectureHalls">An array of lecture hall IDs.</param>
|
/// <param name="lectureHalls">An array of lecture hall IDs.</param>
|
||||||
/// <returns>A response containing schedules for the specified professor.</returns>
|
/// <returns>A response containing schedules for the specified professor.</returns>
|
||||||
[HttpGet("GetByProfessor/{id:int}")]
|
[HttpGet("GetByProfessor/{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
@ -156,7 +152,6 @@ public class ScheduleController(IMediator mediator, IOptionsSnapshot<GeneralConf
|
|||||||
/// <param name="groups">An array of group IDs.</param>
|
/// <param name="groups">An array of group IDs.</param>
|
||||||
/// <returns>A response containing schedules for the specified lecture hall.</returns>
|
/// <returns>A response containing schedules for the specified lecture hall.</returns>
|
||||||
[HttpGet("GetByLectureHall/{id:int}")]
|
[HttpGet("GetByLectureHall/{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
@ -184,7 +179,6 @@ public class ScheduleController(IMediator mediator, IOptionsSnapshot<GeneralConf
|
|||||||
/// <param name="lectureHalls">An array of lecture hall IDs.</param>
|
/// <param name="lectureHalls">An array of lecture hall IDs.</param>
|
||||||
/// <returns>A response containing schedules for the specified discipline.</returns>
|
/// <returns>A response containing schedules for the specified discipline.</returns>
|
||||||
[HttpGet("GetByDiscipline/{id:int}")]
|
[HttpGet("GetByDiscipline/{id:int}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
[BadRequestResponse]
|
[BadRequestResponse]
|
||||||
[NotFoundResponse]
|
[NotFoundResponse]
|
||||||
|
Loading…
Reference in New Issue
Block a user