refactor: remove default produce 200 code
This commit is contained in:
parent
26dbf608b9
commit
f5739647b2
@ -1,6 +1,5 @@
|
||||
using Asp.Versioning;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Mirea.Api.DataAccess.Application.Cqrs.Campus.Queries.GetCampusBasicInfoList;
|
||||
using Mirea.Api.DataAccess.Application.Cqrs.Campus.Queries.GetCampusDetails;
|
||||
@ -21,7 +20,6 @@ public class CampusController(IMediator mediator) : BaseController
|
||||
/// </summary>
|
||||
/// <returns>Basic information about campuses.</returns>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public async Task<ActionResult<List<CampusBasicInfoResponse>>> Get()
|
||||
{
|
||||
var result = await mediator.Send(new GetCampusBasicInfoListQuery());
|
||||
@ -42,7 +40,6 @@ public class CampusController(IMediator mediator) : BaseController
|
||||
/// <param name="id">Campus ID.</param>
|
||||
/// <returns>Details of the specified campus.</returns>
|
||||
[HttpGet("{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
public async Task<ActionResult<CampusDetailsResponse>> GetDetails(int id)
|
||||
|
@ -1,6 +1,5 @@
|
||||
using Asp.Versioning;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Mirea.Api.DataAccess.Application.Cqrs.Discipline.Queries.GetDisciplineDetails;
|
||||
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>
|
||||
/// <returns>Paginated list of disciplines.</returns>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
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>
|
||||
/// <returns>Details of the specified discipline.</returns>
|
||||
[HttpGet("{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
public async Task<ActionResult<DisciplineResponse>> GetDetails(int id)
|
||||
|
@ -1,6 +1,5 @@
|
||||
using Asp.Versioning;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Mirea.Api.DataAccess.Application.Cqrs.Faculty.Queries.GetFacultyDetails;
|
||||
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>
|
||||
/// <returns>Paginated list of faculties.</returns>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
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>
|
||||
/// <returns>Details of the specified faculty.</returns>
|
||||
[HttpGet("{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
public async Task<ActionResult<FacultyDetailsResponse>> GetDetails(int id)
|
||||
|
@ -1,6 +1,5 @@
|
||||
using Asp.Versioning;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Mirea.Api.DataAccess.Application.Cqrs.Group.Queries.GetGroupDetails;
|
||||
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>
|
||||
/// <returns>A list of groups.</returns>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
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>
|
||||
/// <returns>Detailed information about the group.</returns>
|
||||
[HttpGet("{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
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>
|
||||
/// <returns>A list of groups belonging to the specified faculty.</returns>
|
||||
[HttpGet("GetByFaculty/{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
public async Task<ActionResult<List<GroupResponse>>> GetByFaculty(int id)
|
||||
|
@ -1,6 +1,5 @@
|
||||
using Asp.Versioning;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Mirea.Api.DataAccess.Application.Cqrs.LectureHall.Queries.GetLectureHallDetails;
|
||||
using Mirea.Api.DataAccess.Application.Cqrs.LectureHall.Queries.GetLectureHallList;
|
||||
@ -21,7 +20,6 @@ public class LectureHallController(IMediator mediator) : BaseController
|
||||
/// </summary>
|
||||
/// <returns>A list of lecture halls.</returns>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
public async Task<ActionResult<List<LectureHallResponse>>> Get()
|
||||
{
|
||||
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>
|
||||
/// <returns>The details of the specified lecture hall.</returns>
|
||||
[HttpGet("{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
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>
|
||||
/// <returns>A list of lecture halls in the specified campus.</returns>
|
||||
[HttpGet("GetByCampus/{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
public async Task<ActionResult<List<LectureHallResponse>>> GetByCampus(int id)
|
||||
|
@ -1,6 +1,5 @@
|
||||
using Asp.Versioning;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Mirea.Api.DataAccess.Application.Cqrs.Professor.Queries.GetProfessorDetails;
|
||||
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>
|
||||
/// <returns>A list of professors.</returns>
|
||||
[HttpGet]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
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>
|
||||
/// <returns>Detailed information about the professor.</returns>
|
||||
[HttpGet("{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
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>
|
||||
/// <returns>A list of schedules matching the filter criteria.</returns>
|
||||
[HttpPost]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
public async Task<ActionResult<List<ScheduleResponse>>> Get([FromBody] ScheduleRequest request)
|
||||
{
|
||||
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>
|
||||
/// <returns>A response containing schedules for the specified group.</returns>
|
||||
[HttpGet("GetByGroup/{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
@ -128,7 +125,6 @@ public class ScheduleController(IMediator mediator, IOptionsSnapshot<GeneralConf
|
||||
/// <param name="lectureHalls">An array of lecture hall IDs.</param>
|
||||
/// <returns>A response containing schedules for the specified professor.</returns>
|
||||
[HttpGet("GetByProfessor/{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
@ -156,7 +152,6 @@ public class ScheduleController(IMediator mediator, IOptionsSnapshot<GeneralConf
|
||||
/// <param name="groups">An array of group IDs.</param>
|
||||
/// <returns>A response containing schedules for the specified lecture hall.</returns>
|
||||
[HttpGet("GetByLectureHall/{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
@ -184,7 +179,6 @@ public class ScheduleController(IMediator mediator, IOptionsSnapshot<GeneralConf
|
||||
/// <param name="lectureHalls">An array of lecture hall IDs.</param>
|
||||
/// <returns>A response containing schedules for the specified discipline.</returns>
|
||||
[HttpGet("GetByDiscipline/{id:int}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||
[BadRequestResponse]
|
||||
[NotFoundResponse]
|
||||
|
Loading…
Reference in New Issue
Block a user