You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
158 lines
7.4 KiB
158 lines
7.4 KiB
/*
|
|
* Service Collaborateur API
|
|
*
|
|
* Api du service Collaborateur, utilisée pour récupérer les données des collaborateurs d'Apside
|
|
*
|
|
* OpenAPI spec version: 1.1.3
|
|
* Contact: lilian.gayet@apside-groupe.com
|
|
* Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
*/
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using Swashbuckle.AspNetCore.Annotations;
|
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
|
using Newtonsoft.Json;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using IO.Swagger.Attributes;
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
using IO.Swagger.Models;
|
|
|
|
namespace IO.Swagger.Controllers
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
[ApiController]
|
|
public class AgenceApiController : ControllerBase
|
|
{
|
|
/// <summary>
|
|
/// ajout d'une nouvelle agence
|
|
/// </summary>
|
|
/// <param name="body"></param>
|
|
/// <response code="200">Opération terminée avec succès</response>
|
|
/// <response code="400">Mauvais paramètre</response>
|
|
[HttpPost]
|
|
[Route("/agences")]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("AjoutAgence")]
|
|
public virtual IActionResult AjoutAgence([FromBody]NouvelleAgence body)
|
|
{
|
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(200);
|
|
|
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(400);
|
|
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>
|
|
/// rechercher une adresse
|
|
/// </summary>
|
|
/// <remarks>rechercher une agence à l'aide de son identifiant </remarks>
|
|
/// <param name="agenceId">Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée</param>
|
|
/// <response code="200">résultat de la recherche</response>
|
|
/// <response code="400">Mauvais paramètre</response>
|
|
/// <response code="404">il n'y a pas de d'objet recherché possédant cet id</response>
|
|
[HttpGet]
|
|
[Route("/agences/{agenceId}")]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("ChercherAgence")]
|
|
[SwaggerResponse(statusCode: 200, type: typeof(Agence), description: "résultat de la recherche")]
|
|
public virtual IActionResult ChercherAgence([FromRoute][Required]long? agenceId)
|
|
{
|
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(200, default(Agence));
|
|
|
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(400);
|
|
|
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(404);
|
|
string exampleJson = null;
|
|
exampleJson = "{\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n}";
|
|
|
|
var example = exampleJson != null
|
|
? JsonConvert.DeserializeObject<Agence>(exampleJson)
|
|
: default(Agence); //TODO: Change the data returned
|
|
return new ObjectResult(example);
|
|
}
|
|
|
|
/// <summary>
|
|
/// rechercher toutes les agences
|
|
/// </summary>
|
|
/// <remarks>Cette requette demande de récupérer toutes les agences existantes </remarks>
|
|
/// <response code="200">résultats de la recherche</response>
|
|
/// <response code="400">Mauvais paramètre</response>
|
|
/// <response code="404">il n'y a pas d'agence</response>
|
|
[HttpGet]
|
|
[Route("/agences")]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("ChercherAgences")]
|
|
[SwaggerResponse(statusCode: 200, type: typeof(List<Agence>), description: "résultats de la recherche")]
|
|
public virtual IActionResult ChercherAgences()
|
|
{
|
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(200, default(List<Agence>));
|
|
|
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(400);
|
|
|
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(404);
|
|
string exampleJson = null;
|
|
exampleJson = "[ {\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n}, {\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n} ]";
|
|
|
|
var example = exampleJson != null
|
|
? JsonConvert.DeserializeObject<List<Agence>>(exampleJson)
|
|
: default(List<Agence>); //TODO: Change the data returned
|
|
return new ObjectResult(example);
|
|
}
|
|
|
|
/// <summary>
|
|
/// mettre à jour une agence
|
|
/// </summary>
|
|
/// <param name="agenceId">Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée</param>
|
|
/// <param name="body"></param>
|
|
/// <response code="200">Opération terminée avec succès</response>
|
|
/// <response code="400">Mauvais paramètre</response>
|
|
[HttpPut]
|
|
[Route("/agences/{agenceId}")]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("MajAgence")]
|
|
public virtual IActionResult MajAgence([FromRoute][Required]long? agenceId, [FromBody]NouvelleAgence body)
|
|
{
|
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(200);
|
|
|
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(400);
|
|
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
/// <summary>
|
|
/// mettre à jour une agence
|
|
/// </summary>
|
|
/// <param name="agenceId">Ce paramêtre permet de renseigner l'identifiant de l'agence recherchée</param>
|
|
/// <param name="body"></param>
|
|
/// <response code="200">Opération terminée avec succès</response>
|
|
/// <response code="400">Mauvais paramètre</response>
|
|
[HttpPatch]
|
|
[Route("/agences/{agenceId}")]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("MajAgencepatch")]
|
|
public virtual IActionResult MajAgencepatch([FromRoute][Required]long? agenceId, [FromBody]NouvelleAgence body)
|
|
{
|
|
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(200);
|
|
|
|
//TODO: Uncomment the next line to return response 400 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
|
// return StatusCode(400);
|
|
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|
|
|