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.
191 lines
9.8 KiB
191 lines
9.8 KiB
4 years ago
|
/*
|
||
|
* 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 ProjetApiController : ControllerBase
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// ajout d'un nouveau projet
|
||
|
/// </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("/projets")]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("AjoutProjet")]
|
||
|
public virtual IActionResult AjoutProjet([FromBody]NouveauProjet 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 un projet
|
||
|
/// </summary>
|
||
|
/// <remarks>rechercher un projet à l'aide de son identifiant </remarks>
|
||
|
/// <param name="projetId">Ce paramêtre permet de renseigner l'identifiant du projet recherché</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("/projets/{projetId}")]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("ChercherProjet")]
|
||
|
[SwaggerResponse(statusCode: 200, type: typeof(Projet), description: "résultat de la recherche")]
|
||
|
public virtual IActionResult ChercherProjet([FromRoute][Required]long? projetId)
|
||
|
{
|
||
|
//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(Projet));
|
||
|
|
||
|
//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 \"debut\" : \"2000-01-23\",\n \"client\" : \"client\",\n \"description\" : \"description\",\n \"fin\" : \"2000-01-23\",\n \"id\" : 5,\n \"nom\" : \"nom\"\n}";
|
||
|
|
||
|
var example = exampleJson != null
|
||
|
? JsonConvert.DeserializeObject<Projet>(exampleJson)
|
||
|
: default(Projet); //TODO: Change the data returned
|
||
|
return new ObjectResult(example);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// rechercher toutes les projets
|
||
|
/// </summary>
|
||
|
/// <remarks>Cette requette demande de récupérer tous les projets existants </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 de projet</response>
|
||
|
[HttpGet]
|
||
|
[Route("/projets")]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("ChercherProjets")]
|
||
|
[SwaggerResponse(statusCode: 200, type: typeof(List<Projet>), description: "résultats de la recherche")]
|
||
|
public virtual IActionResult ChercherProjets()
|
||
|
{
|
||
|
//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<Projet>));
|
||
|
|
||
|
//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 \"debut\" : \"2000-01-23\",\n \"client\" : \"client\",\n \"description\" : \"description\",\n \"fin\" : \"2000-01-23\",\n \"id\" : 5,\n \"nom\" : \"nom\"\n}, {\n \"debut\" : \"2000-01-23\",\n \"client\" : \"client\",\n \"description\" : \"description\",\n \"fin\" : \"2000-01-23\",\n \"id\" : 5,\n \"nom\" : \"nom\"\n} ]";
|
||
|
|
||
|
var example = exampleJson != null
|
||
|
? JsonConvert.DeserializeObject<List<Projet>>(exampleJson)
|
||
|
: default(List<Projet>); //TODO: Change the data returned
|
||
|
return new ObjectResult(example);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// rechercher tous les projets
|
||
|
/// </summary>
|
||
|
/// <remarks>Cette requette demande de récupérer tous les projets existants </remarks>
|
||
|
/// <param name="nomClient">Ce paramêtre permet de renseigner le nom du client lié au projet</param>
|
||
|
/// <response code="200">résultats de la recherche</response>
|
||
|
/// <response code="400">Mauvais paramètre</response>
|
||
|
/// <response code="404">il n'y a pas de projet</response>
|
||
|
[HttpGet]
|
||
|
[Route("/projets/{nomClient}")]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("ChercherProjetsClient")]
|
||
|
[SwaggerResponse(statusCode: 200, type: typeof(List<Projet>), description: "résultats de la recherche")]
|
||
|
public virtual IActionResult ChercherProjetsClient([FromRoute][Required]string nomClient)
|
||
|
{
|
||
|
//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<Projet>));
|
||
|
|
||
|
//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 \"debut\" : \"2000-01-23\",\n \"client\" : \"client\",\n \"description\" : \"description\",\n \"fin\" : \"2000-01-23\",\n \"id\" : 5,\n \"nom\" : \"nom\"\n}, {\n \"debut\" : \"2000-01-23\",\n \"client\" : \"client\",\n \"description\" : \"description\",\n \"fin\" : \"2000-01-23\",\n \"id\" : 5,\n \"nom\" : \"nom\"\n} ]";
|
||
|
|
||
|
var example = exampleJson != null
|
||
|
? JsonConvert.DeserializeObject<List<Projet>>(exampleJson)
|
||
|
: default(List<Projet>); //TODO: Change the data returned
|
||
|
return new ObjectResult(example);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
/// mettre à jour un projet
|
||
|
/// </summary>
|
||
|
/// <param name="projetId">Ce paramêtre permet de renseigner l'identifiant du projet recherché</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("/projets/{projetId}")]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("MajProjet")]
|
||
|
public virtual IActionResult MajProjet([FromRoute][Required]long? projetId, [FromBody]NouveauProjet 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 un projet
|
||
|
/// </summary>
|
||
|
/// <param name="projetId">Ce paramêtre permet de renseigner l'identifiant du projet recherché</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("/projets/{projetId}")]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("MajProjetpatch")]
|
||
|
public virtual IActionResult MajProjetpatch([FromRoute][Required]long? projetId, [FromBody]NouveauProjet 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();
|
||
|
}
|
||
|
}
|
||
|
}
|