|
|
|
@ -29,9 +29,20 @@ namespace BowlingApi.Controllers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Get all partie
|
|
|
|
|
/// GET: api/parti
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>la liste des parti </returns>
|
|
|
|
|
/// <response code="200">Retourne la liste des joueurs</response>
|
|
|
|
|
/// <response code="404">Si la liste est vide</response>
|
|
|
|
|
/// <response code="500">Si une erreur est survenue</response>
|
|
|
|
|
// GET: api/Partie
|
|
|
|
|
[HttpGet]
|
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)]
|
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status400BadRequest)]
|
|
|
|
|
[ProducesResponseType(typeof(JoueurDTO), StatusCodes.Status200OK)]
|
|
|
|
|
public async Task<IActionResult> Get()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
@ -78,9 +89,18 @@ namespace BowlingApi.Controllers
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// POST: api/Partie
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Creeation
|
|
|
|
|
/// POST: api/parti
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="parti"></param>
|
|
|
|
|
/// <response code="201">Retourne la parti créé</response>
|
|
|
|
|
/// <response code="400">Si la parti est null</response>
|
|
|
|
|
/// <response code="500">Si une erreur est survenue</response>
|
|
|
|
|
[HttpPost]
|
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status400BadRequest)]
|
|
|
|
|
[ProducesResponseType(typeof(JoueurDTO), StatusCodes.Status201Created)]
|
|
|
|
|
public async Task<ActionResult<PartieDTO>> Post([FromBody] PartieDTO parti)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -103,8 +123,22 @@ namespace BowlingApi.Controllers
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PUT: api/Partie/5
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Modification partie
|
|
|
|
|
/// PUT: api/parti/5
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="id"></param>
|
|
|
|
|
/// <param name="partie"></param>
|
|
|
|
|
/// <response code="200">Retourne la modification</response>
|
|
|
|
|
/// <response code="400">Si le partie est null</response>
|
|
|
|
|
/// <response code="404">Si le partie n'existe pas</response>
|
|
|
|
|
/// <response code="500">Si une erreur est survenue</response>
|
|
|
|
|
[HttpPut("{id}")]
|
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status500InternalServerError)]
|
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status404NotFound)]
|
|
|
|
|
[ProducesResponseType(typeof(string), StatusCodes.Status400BadRequest)]
|
|
|
|
|
[ProducesResponseType(typeof(PartieDTO), StatusCodes.Status200OK)]
|
|
|
|
|
|
|
|
|
|
public async Task<ActionResult<PartieDTO>> Put(long id, [FromBody] PartieDTO partie)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|