docs update
This commit is contained in:
parent
a7566e2cd3
commit
8a80013c94
3 changed files with 20 additions and 1 deletions
|
|
@ -67,6 +67,11 @@ public class AuthController : ControllerBase
|
||||||
return Ok(new { token = token });
|
return Ok(new { token = token });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Получить информацию о нынешнем юзере
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Возвращает инфо о пользователе, токен которого был использован</remarks>
|
||||||
|
/// <returns></returns>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[HttpGet("me")]
|
[HttpGet("me")]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
|
|
||||||
|
|
@ -56,6 +56,13 @@ public class QuestionController : ControllerBase
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Обновляет вопрос целиком
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="dto"></param>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="surveyId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[HttpPut("{id}")]
|
[HttpPut("{id}")]
|
||||||
public async Task<IActionResult> UpdateQuestion([FromBody] QuestionUpdateDto dto, [FromRoute] int id,
|
public async Task<IActionResult> UpdateQuestion([FromBody] QuestionUpdateDto dto, [FromRoute] int id,
|
||||||
|
|
@ -67,6 +74,12 @@ public class QuestionController : ControllerBase
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Удаляет вопрос по его ID
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="surveyId"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[Authorize]
|
[Authorize]
|
||||||
[HttpDelete("{id}")]
|
[HttpDelete("{id}")]
|
||||||
public async Task<IActionResult> DeleteQuestion([FromRoute] int id, [FromRoute] int surveyId)
|
public async Task<IActionResult> DeleteQuestion([FromRoute] int id, [FromRoute] int surveyId)
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,8 @@ public class SurveyController : ControllerBase
|
||||||
{
|
{
|
||||||
var userId = _userContext.UserId;
|
var userId = _userContext.UserId;
|
||||||
|
|
||||||
var result = await _surveyService.GetSurveysByUserIdAsync(userId);
|
var surveys = await _surveyService.GetSurveysByUserIdAsync(userId);
|
||||||
|
var result = surveys.Select(SurveyMapper.ModelToOutputDto);
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue