controllers to naming

This commit is contained in:
Вячеслав 2025-05-13 19:16:20 +05:00
parent 2cb7fdbfb7
commit 9555497d4e
2 changed files with 7 additions and 7 deletions

View file

@ -29,7 +29,7 @@ public class QuestionController : ControllerBase
[AllowAnonymous]
[HttpGet]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(typeof(List<OutputQuestionDto>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(List<QuestionOutputDto>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetBySurveyId([FromRoute] int surveyId)
{
var questions = await _questionService.GetQuestionsBySurveyIdAsync(surveyId);
@ -48,7 +48,7 @@ public class QuestionController : ControllerBase
[HttpPost]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> AddQuestion(CreateQuestionDto dto, [FromRoute] int surveyId)
public async Task<IActionResult> AddQuestion(QuestionCreateDto dto, [FromRoute] int surveyId)
{
var model = QuestionMapper.QuestionCreationToModel(dto, surveyId);
await _questionService.AddQuestionAsync(model);

View file

@ -32,7 +32,7 @@ public class SurveyController : ControllerBase
/// <returns></returns>
[AllowAnonymous]
[HttpGet]
[ProducesResponseType(typeof(List<OutputSurveyDto>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(List<SurveyOutputDto>), StatusCodes.Status200OK)]
public async Task<IActionResult> Get()
{
var surveys = await _surveyService.GetSurveysAsync();
@ -49,7 +49,7 @@ public class SurveyController : ControllerBase
[AllowAnonymous]
[HttpGet("{id}")]
[ProducesResponseType(StatusCodes.Status404NotFound)]
[ProducesResponseType(typeof(OutputSurveyDto), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(SurveyOutputDto), StatusCodes.Status200OK)]
public async Task<IActionResult> Get(int id)
{
var survey = await _surveyService.GetSurveyAsync(id);
@ -66,7 +66,7 @@ public class SurveyController : ControllerBase
[Authorize]
[HttpPost]
[ProducesResponseType(StatusCodes.Status200OK)]
public async Task<IActionResult> Post([FromBody] CreateSurveyDto dto)
public async Task<IActionResult> Post([FromBody] SurveyCreateDto dto)
{
var userId = _userContext.UserId;
@ -84,7 +84,7 @@ public class SurveyController : ControllerBase
/// <returns></returns>
[Authorize]
[HttpPut("{id}")]
public async Task<IActionResult> Put(int id, [FromBody] UpdateSurveyDto dto)
public async Task<IActionResult> Put(int id, [FromBody] SurveyUpdateDto dto)
{
var userId = _userContext.UserId;
var survey = SurveyMapper.UpdateDtoToModel(dto, userId, id);
@ -118,7 +118,7 @@ public class SurveyController : ControllerBase
[Authorize]
[HttpGet("my")]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(typeof(List<OutputSurveyDto>), StatusCodes.Status200OK)]
[ProducesResponseType(typeof(List<SurveyOutputDto>), StatusCodes.Status200OK)]
public async Task<IActionResult> GetMySurveys()
{
var userId = _userContext.UserId;