|
|
@ -29,15 +29,15 @@ namespace API.Controllers
|
|
|
|
return Ok(users);
|
|
|
|
return Ok(users);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet("user/{id}")]
|
|
|
|
[HttpGet("user/id/{id}")]
|
|
|
|
[ProducesResponseType(typeof(UserDTO), 200)]
|
|
|
|
[ProducesResponseType(typeof(UserDTO), 200)]
|
|
|
|
[ProducesResponseType(typeof(string), 404)]
|
|
|
|
[ProducesResponseType(typeof(string), 404)]
|
|
|
|
public IActionResult GetUserById(int id)
|
|
|
|
public async Task<IActionResult> GetUserById(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
try
|
|
|
|
try
|
|
|
|
{
|
|
|
|
{
|
|
|
|
logger.LogInformation("[INFORMATION] Utilisateur avec l'id {id} a été trouvé.", id);
|
|
|
|
logger.LogInformation("[INFORMATION] Utilisateur avec l'id {id} a été trouvé.", id);
|
|
|
|
return Ok(dataService.userService.GetUserById(id));
|
|
|
|
return Ok( (await dataService.userService.GetItems(1, 1, null, UserOrderCriteria.ById.ToString().Substring(2), id)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (ArgumentException)
|
|
|
|
catch (ArgumentException)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -46,7 +46,7 @@ namespace API.Controllers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpGet("user/{username}")]
|
|
|
|
[HttpGet("user/username/{username}")]
|
|
|
|
[ProducesResponseType(typeof(UserDTO), 200)]
|
|
|
|
[ProducesResponseType(typeof(UserDTO), 200)]
|
|
|
|
[ProducesResponseType(typeof(string), 404)]
|
|
|
|
[ProducesResponseType(typeof(string), 404)]
|
|
|
|
public IActionResult GetUserByUsername(string username)
|
|
|
|
public IActionResult GetUserByUsername(string username)
|
|
|
@ -63,7 +63,7 @@ namespace API.Controllers
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[HttpDelete("user/{id}")]
|
|
|
|
[HttpDelete]
|
|
|
|
[ProducesResponseType(typeof(UserDTO), 200)]
|
|
|
|
[ProducesResponseType(typeof(UserDTO), 200)]
|
|
|
|
[ProducesResponseType(typeof(string), 404)]
|
|
|
|
[ProducesResponseType(typeof(string), 404)]
|
|
|
|
public IActionResult DeleteUser(int id)
|
|
|
|
public IActionResult DeleteUser(int id)
|
|
|
|