add test docs for swagger
This commit is contained in:
parent
41f747e008
commit
cd1f98f575
1 changed files with 14 additions and 0 deletions
|
|
@ -17,6 +17,14 @@ public class AuthController : ControllerBase
|
||||||
_authorizationService = authorizationService;
|
_authorizationService = authorizationService;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Авторизация
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Принимает на вход email и password. При отсутствии такого email вернет 404, при неправильном пароле 401, при успехе 200 и валидный токен</remarks>
|
||||||
|
/// <param name="loginData"></param>
|
||||||
|
/// <response code="200">Success: Возвращает токен</response>
|
||||||
|
/// <response code="401">Unauthorized: Неправильный пароль</response>
|
||||||
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpPost("login")]
|
[HttpPost("login")]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
|
@ -27,6 +35,12 @@ public class AuthController : ControllerBase
|
||||||
return Ok(new { token = token });
|
return Ok(new { token = token });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Регистрация
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Принимает на вход кучу всяких полей, потом разберемся</remarks>
|
||||||
|
/// <param name="registerData"></param>
|
||||||
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
[HttpPost("register")]
|
[HttpPost("register")]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue