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.5 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 BusinessUnitApiController : ControllerBase
{
/// <summary>
/// ajout d&#x27;une nouvelle business-unit
/// </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("/bus")]
[ValidateModelState]
[SwaggerOperation("AjoutBU")]
public virtual IActionResult AjoutBU([FromBody]NouvelleBU 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 business-unit
/// </summary>
/// <remarks>rechercher une business-unit à l&#x27;aide de son identifiant </remarks>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit recherchée</param>
/// <response code="200">résultat de la recherche</response>
/// <response code="400">Mauvais paramètre</response>
/// <response code="404">il n&#x27;y a pas de d&#x27;objet recherché possédant cet id</response>
[HttpGet]
[Route("/bus/{buId}")]
[ValidateModelState]
[SwaggerOperation("ChercherBU")]
[SwaggerResponse(statusCode: 200, type: typeof(BU), description: "résultat de la recherche")]
public virtual IActionResult ChercherBU([FromRoute][Required]long? buId)
{
//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(BU));
//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 \"agence\" : {\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n },\n \"id\" : 1,\n \"nom\" : \"nom\"\n}";
var example = exampleJson != null
? JsonConvert.DeserializeObject<BU>(exampleJson)
: default(BU); //TODO: Change the data returned
return new ObjectResult(example);
}
/// <summary>
/// rechercher toutes les business-units
/// </summary>
/// <remarks>Cette requette demande de récupérer toutes les business-units existantes </remarks>
/// <response code="200">résultats de la recherche</response>
/// <response code="400">Mauvais paramètre</response>
/// <response code="404">il n&#x27;y a pas de business-unit</response>
[HttpGet]
[Route("/bus")]
[ValidateModelState]
[SwaggerOperation("ChercherBUs")]
[SwaggerResponse(statusCode: 200, type: typeof(List<BU>), description: "résultats de la recherche")]
public virtual IActionResult ChercherBUs()
{
//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<BU>));
//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 \"agence\" : {\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n },\n \"id\" : 1,\n \"nom\" : \"nom\"\n}, {\n \"agence\" : {\n \"bus\" : [ null, null ],\n \"id\" : 5,\n \"nom\" : \"nom\"\n },\n \"id\" : 1,\n \"nom\" : \"nom\"\n} ]";
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<BU>>(exampleJson)
: default(List<BU>); //TODO: Change the data returned
return new ObjectResult(example);
}
/// <summary>
/// mettre à jour une business-unit
/// </summary>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit 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("/bus/{buId}")]
[ValidateModelState]
[SwaggerOperation("MajBU")]
public virtual IActionResult MajBU([FromRoute][Required]long? buId, [FromBody]NouvelleBU 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 business-unit
/// </summary>
/// <param name="buId">Ce paramêtre permet de renseigner l&#x27;identifiant de la business-unit 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("/bus/{buId}")]
[ValidateModelState]
[SwaggerOperation("MajBUpatch")]
public virtual IActionResult MajBUpatch([FromRoute][Required]long? buId, [FromBody]NouvelleBU 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();
}
}
}