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.
295 lines
24 KiB
295 lines
24 KiB
4 years ago
|
/*
|
||
|
* API du serveur de l'application de digitalisation des EP
|
||
|
*
|
||
|
* API qui sra utilisée afin de faire communiquer le client et le serveur ainsi que le serveur et la boîte noire.
|
||
|
*
|
||
4 years ago
|
* OpenAPI spec version: 1.3.4
|
||
4 years ago
|
*
|
||
|
* 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 IO.Swagger.Security;
|
||
|
using Microsoft.AspNetCore.Authorization;
|
||
|
using IO.Swagger.DTO;
|
||
|
|
||
|
namespace IO.Swagger.Controllers
|
||
|
{
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
[ApiController]
|
||
|
public class DemandesEPIApiController : ControllerBase
|
||
|
{
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <remarks>Annuler la demande d'EPI</remarks>
|
||
|
/// <param name="idDemandeEPI">id demande EPI</param>
|
||
|
/// <response code="200">demande d'EPI annulée</response>
|
||
|
/// <response code="403">Acces interdit</response>
|
||
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
||
|
[HttpGet]
|
||
|
[Route("/api/demandesepi/{idDemandeEPI}/annuler")]
|
||
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("AnnulerDemandeEPI")]
|
||
|
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
|
||
|
[SwaggerResponse(statusCode: 404, type: typeof(ErreurDTO), description: "Ressource n'a pas été trouvée")]
|
||
4 years ago
|
public virtual IActionResult AnnulerDemandeEPI([FromRoute][Required]long? idDemandeEPI)
|
||
4 years ago
|
{
|
||
|
//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 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(403, default(ErreurDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(404, default(ErreurDTO));
|
||
|
|
||
|
throw new NotImplementedException();
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <remarks>Lancer la procedure pour un entretien professionnel intermediaire, une demande d'EPI validée est créé par la même occasion</remarks>
|
||
|
/// <param name="idCollaborateur">id collaborateur</param>
|
||
|
/// <param name="idReferent">id referent</param>
|
||
|
/// <response code="200">Demande d'EPI créée avec l'EPI correspondant</response>
|
||
|
/// <response code="403">Acces interdit</response>
|
||
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
||
|
[HttpGet]
|
||
|
[Route("/api/demandesepi/referent/{idReferent}/demande/{idCollaborateur}")]
|
||
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("CreateEPI")]
|
||
|
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
|
||
|
[SwaggerResponse(statusCode: 404, type: typeof(ErreurDTO), description: "Ressource n'a pas été trouvée")]
|
||
|
public virtual IActionResult CreateEPI([FromRoute][Required]Guid? idCollaborateur, [FromRoute][Required]Guid? idReferent)
|
||
|
{
|
||
|
//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 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(403, default(ErreurDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(404, default(ErreurDTO));
|
||
|
|
||
|
throw new NotImplementedException();
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <remarks>Demande d'EPI par un collaborateur</remarks>
|
||
|
/// <param name="idCollaborateur">id collaborateur</param>
|
||
|
/// <response code="200">demande d'EPI effectuée</response>
|
||
|
/// <response code="403">Acces interdit</response>
|
||
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
||
|
[HttpGet]
|
||
|
[Route("/api/demandesepi/collaborateur/{idCollaborateur}/demande")]
|
||
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("DemandeEPI")]
|
||
|
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
|
||
|
[SwaggerResponse(statusCode: 404, type: typeof(ErreurDTO), description: "Ressource n'a pas été trouvée")]
|
||
|
public virtual IActionResult DemandeEPI([FromRoute][Required]Guid? idCollaborateur)
|
||
|
{
|
||
|
//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 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(403, default(ErreurDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(404, default(ErreurDTO));
|
||
|
|
||
|
throw new NotImplementedException();
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <remarks>Demande d'EPI et par l'assistant et création automatique de l'EPI</remarks>
|
||
|
/// <param name="idCollaborateur">id collaborateur</param>
|
||
|
/// <response code="200">Demande d'EPI créée avec l'EPI correspondant</response>
|
||
|
/// <response code="403">Acces interdit</response>
|
||
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
||
|
[HttpGet]
|
||
|
[Route("/api/demandesepi/demandeassistante/{idCollaborateur}")]
|
||
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("DemandeEPIAssistante")]
|
||
|
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
|
||
|
[SwaggerResponse(statusCode: 404, type: typeof(ErreurDTO), description: "Ressource n'a pas été trouvée")]
|
||
|
public virtual IActionResult DemandeEPIAssistante([FromRoute][Required]Guid? idCollaborateur)
|
||
|
{
|
||
|
//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 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(403, default(ErreurDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(404, default(ErreurDTO));
|
||
|
|
||
|
throw new NotImplementedException();
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
4 years ago
|
/// <remarks>Récupération de la liste des demandes EPI d'un collaborateur</remarks>
|
||
|
/// <param name="asc">Préciser si les données sont dans l'ordre (true) ou dans l'ordre inverse (false)</param>
|
||
4 years ago
|
/// <param name="idCollaborateur">id collaborateur</param>
|
||
4 years ago
|
/// <param name="numPage">Numéro de la page du tableau qui affiche les données</param>
|
||
|
/// <param name="parPAge">Nombre d'éléments affiché sur chaque page du tableau</param>
|
||
|
/// <param name="fonctions">Liste des fonctions des collaborateurs que l'on veut récupérer</param>
|
||
|
/// <param name="texte">Texte permettant d'identifier l'objet rechercher</param>
|
||
|
/// <param name="tri">Colonne du tableau sur lequel le tri s'effectue</param>
|
||
4 years ago
|
/// <response code="200">OK</response>
|
||
|
/// <response code="403">Acces interdit</response>
|
||
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
||
|
[HttpGet]
|
||
|
[Route("/api/demandesepi/collaborateur/{idCollaborateur}")]
|
||
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||
|
[ValidateModelState]
|
||
4 years ago
|
[SwaggerOperation("GetDemandeEPICollaborateur")]
|
||
4 years ago
|
[SwaggerResponse(statusCode: 200, type: typeof(List<DemandeEPIDTO>), description: "OK")]
|
||
|
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
|
||
|
[SwaggerResponse(statusCode: 404, type: typeof(ErreurDTO), description: "Ressource n'a pas été trouvée")]
|
||
4 years ago
|
public virtual IActionResult GetDemandeEPICollaborateur([FromQuery][Required()]bool? asc, [FromRoute][Required]Guid? idCollaborateur, [FromQuery][Required()]int? numPage, [FromQuery][Required()]int? parPAge, [FromQuery]List<string> fonctions, [FromQuery]string texte, [FromQuery]string tri)
|
||
4 years ago
|
{
|
||
|
//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<DemandeEPIDTO>));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(403, default(ErreurDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(404, default(ErreurDTO));
|
||
|
string exampleJson = null;
|
||
4 years ago
|
exampleJson = "[ {\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"reponse\" : true,\n \"idReferent\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"raisonRefus\" : \"raisonRefus\",\n \"dateReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6,\n \"nom\" : \"nom\"\n },\n \"id\" : 0,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1\n },\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\",\n \"etat\" : 6\n}, {\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"reponse\" : true,\n \"idReferent\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"raisonRefus\" : \"raisonRefus\",\n \"dateReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6,\n \"nom\" : \"nom\"\n },\n \"id\" : 0,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1\n },\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\",\n \"etat\" : 6\n} ]";
|
||
4 years ago
|
|
||
|
var example = exampleJson != null
|
||
|
? JsonConvert.DeserializeObject<List<DemandeEPIDTO>>(exampleJson)
|
||
|
: default(List<DemandeEPIDTO>); //TODO: Change the data returned
|
||
|
return new ObjectResult(example);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <remarks>Récupération de l'EPI en cours d'un collaborateur</remarks>
|
||
|
/// <param name="idCollaborateur">id collaborateur</param>
|
||
|
/// <response code="200">OK</response>
|
||
|
/// <response code="403">Acces interdit</response>
|
||
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
||
|
[HttpGet]
|
||
|
[Route("/api/demandesepi/collaborateur/{idCollaborateur}/enCours")]
|
||
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||
|
[ValidateModelState]
|
||
4 years ago
|
[SwaggerOperation("GetDemandeEPIEnCours")]
|
||
4 years ago
|
[SwaggerResponse(statusCode: 200, type: typeof(DemandeEPIDTO), description: "OK")]
|
||
|
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
|
||
|
[SwaggerResponse(statusCode: 404, type: typeof(ErreurDTO), description: "Ressource n'a pas été trouvée")]
|
||
4 years ago
|
public virtual IActionResult GetDemandeEPIEnCours([FromRoute][Required]Guid? idCollaborateur)
|
||
4 years ago
|
{
|
||
|
//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(DemandeEPIDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(403, default(ErreurDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(404, default(ErreurDTO));
|
||
|
string exampleJson = null;
|
||
4 years ago
|
exampleJson = "{\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"reponse\" : true,\n \"idReferent\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"raisonRefus\" : \"raisonRefus\",\n \"dateReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6,\n \"nom\" : \"nom\"\n },\n \"id\" : 0,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1\n },\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\",\n \"etat\" : 6\n}";
|
||
4 years ago
|
|
||
|
var example = exampleJson != null
|
||
|
? JsonConvert.DeserializeObject<DemandeEPIDTO>(exampleJson)
|
||
|
: default(DemandeEPIDTO); //TODO: Change the data returned
|
||
|
return new ObjectResult(example);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
4 years ago
|
/// <remarks>Récupération de la liste des demandes EPI d'un referent</remarks>
|
||
|
/// <param name="asc">Préciser si les données sont dans l'ordre (true) ou dans l'ordre inverse (false)</param>
|
||
4 years ago
|
/// <param name="idReferent">id referent</param>
|
||
4 years ago
|
/// <param name="numPage">Numéro de la page du tableau qui affiche les données</param>
|
||
|
/// <param name="parPAge">Nombre d'éléments affiché sur chaque page du tableau</param>
|
||
|
/// <param name="fonctions">Liste des fonctions des collaborateurs que l'on veut récupérer</param>
|
||
|
/// <param name="texte">Texte permettant d'identifier l'objet rechercher</param>
|
||
|
/// <param name="tri">Colonne du tableau sur lequel le tri s'effectue</param>
|
||
4 years ago
|
/// <response code="200">OK</response>
|
||
|
/// <response code="403">Acces interdit</response>
|
||
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
||
|
[HttpGet]
|
||
|
[Route("/api/demandesepi/referent/{idReferent}")]
|
||
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||
|
[ValidateModelState]
|
||
4 years ago
|
[SwaggerOperation("GetDemandeEPIReferent")]
|
||
4 years ago
|
[SwaggerResponse(statusCode: 200, type: typeof(List<DemandeEPIDTO>), description: "OK")]
|
||
|
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
|
||
|
[SwaggerResponse(statusCode: 404, type: typeof(ErreurDTO), description: "Ressource n'a pas été trouvée")]
|
||
4 years ago
|
public virtual IActionResult GetDemandeEPIReferent([FromQuery][Required()]bool? asc, [FromRoute][Required]Guid? idReferent, [FromQuery][Required()]int? numPage, [FromQuery][Required()]int? parPAge, [FromQuery]List<string> fonctions, [FromQuery]string texte, [FromQuery]string tri)
|
||
4 years ago
|
{
|
||
|
//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<DemandeEPIDTO>));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(403, default(ErreurDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(404, default(ErreurDTO));
|
||
|
string exampleJson = null;
|
||
4 years ago
|
exampleJson = "[ {\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"reponse\" : true,\n \"idReferent\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"raisonRefus\" : \"raisonRefus\",\n \"dateReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6,\n \"nom\" : \"nom\"\n },\n \"id\" : 0,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1\n },\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\",\n \"etat\" : 6\n}, {\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"reponse\" : true,\n \"idReferent\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"raisonRefus\" : \"raisonRefus\",\n \"dateReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6,\n \"nom\" : \"nom\"\n },\n \"id\" : 0,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1\n },\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\",\n \"etat\" : 6\n} ]";
|
||
4 years ago
|
|
||
|
var example = exampleJson != null
|
||
|
? JsonConvert.DeserializeObject<List<DemandeEPIDTO>>(exampleJson)
|
||
|
: default(List<DemandeEPIDTO>); //TODO: Change the data returned
|
||
|
return new ObjectResult(example);
|
||
|
}
|
||
|
|
||
|
/// <summary>
|
||
|
///
|
||
|
/// </summary>
|
||
|
/// <remarks>Répondre à une demande EPI en attente</remarks>
|
||
|
/// <param name="body"></param>
|
||
|
/// <param name="idDemandeEPI">id demande EPI</param>
|
||
|
/// <response code="200">Réponse à la demande d'EPI envoyée</response>
|
||
|
/// <response code="403">Acces interdit</response>
|
||
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
||
|
[HttpPut]
|
||
|
[Route("/api/demandesepi/{idDemandeEPI}/repondre")]
|
||
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
||
|
[ValidateModelState]
|
||
|
[SwaggerOperation("RepondreDemandeEPI")]
|
||
|
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
|
||
|
[SwaggerResponse(statusCode: 404, type: typeof(ErreurDTO), description: "Ressource n'a pas été trouvée")]
|
||
4 years ago
|
public virtual IActionResult RepondreDemandeEPI([FromBody]DemandeEPIDTO body, [FromRoute][Required]long? idDemandeEPI)
|
||
4 years ago
|
{
|
||
|
//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 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(403, default(ErreurDTO));
|
||
|
|
||
|
//TODO: Uncomment the next line to return response 404 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
|
||
|
// return StatusCode(404, default(ErreurDTO));
|
||
|
|
||
|
throw new NotImplementedException();
|
||
|
}
|
||
|
}
|
||
|
}
|