/* * 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 { /// /// /// [ApiController] public class AdresseApiController : ControllerBase { /// /// ajout d'une nouvelle adresse /// /// /// Opération terminée avec succès /// Mauvais paramètre [HttpPost] [Route("/adresses")] [ValidateModelState] [SwaggerOperation("AjoutAdresse")] public virtual IActionResult AjoutAdresse([FromBody]NouvelleAdresse 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(); } /// /// rechercher une adresse /// /// rechercher une adresse à l'aide de son identifiant /// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée /// résultat de la recherche /// Mauvais paramètre /// il n'y a pas de d'objet recherché possédant cet id [HttpGet] [Route("/adresses/{adresseId}")] [ValidateModelState] [SwaggerOperation("ChercherAdresse")] [SwaggerResponse(statusCode: 200, type: typeof(Adresse), description: "résultat de la recherche")] public virtual IActionResult ChercherAdresse([FromRoute][Required]long? adresseId) { //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(Adresse)); //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 \"ville\" : \"ville\",\n \"rue\" : \"rue\",\n \"dateDebut\" : \"2000-01-23\",\n \"id\" : 6,\n \"codePostal\" : \"codePostal\",\n \"dateFin\" : \"2000-01-23\",\n \"pays\" : \"pays\"\n}"; var example = exampleJson != null ? JsonConvert.DeserializeObject(exampleJson) : default(Adresse); //TODO: Change the data returned return new ObjectResult(example); } /// /// rechercher toutes les adresses /// /// Cette requette demande de récupérer toutes les adresses existantes /// résultats de la recherche /// Mauvais paramètre /// il n'y a pas d'adresse [HttpGet] [Route("/adresses")] [ValidateModelState] [SwaggerOperation("ChercherAdresses")] [SwaggerResponse(statusCode: 200, type: typeof(List), description: "résultats de la recherche")] public virtual IActionResult ChercherAdresses() { //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)); //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 \"ville\" : \"ville\",\n \"rue\" : \"rue\",\n \"dateDebut\" : \"2000-01-23\",\n \"id\" : 6,\n \"codePostal\" : \"codePostal\",\n \"dateFin\" : \"2000-01-23\",\n \"pays\" : \"pays\"\n}, {\n \"ville\" : \"ville\",\n \"rue\" : \"rue\",\n \"dateDebut\" : \"2000-01-23\",\n \"id\" : 6,\n \"codePostal\" : \"codePostal\",\n \"dateFin\" : \"2000-01-23\",\n \"pays\" : \"pays\"\n} ]"; var example = exampleJson != null ? JsonConvert.DeserializeObject>(exampleJson) : default(List); //TODO: Change the data returned return new ObjectResult(example); } /// /// mettre à jour une adresse /// /// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée /// /// Opération terminée avec succès /// Mauvais paramètre [HttpPut] [Route("/adresses/{adresseId}")] [ValidateModelState] [SwaggerOperation("MajAdresse")] public virtual IActionResult MajAdresse([FromRoute][Required]long? adresseId, [FromBody]NouvelleAdresse 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(); } /// /// mettre à jour une adresse /// /// Ce paramêtre permet de renseigner l'identifiant de l'adresse recherchée /// /// Opération terminée avec succès /// Mauvais paramètre [HttpPatch] [Route("/adresses/{adresseId}")] [ValidateModelState] [SwaggerOperation("MajAdressepatch")] public virtual IActionResult MajAdressepatch([FromRoute][Required]long? adresseId, [FromBody]NouvelleAdresse 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(); } } }