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.
175 lines
12 KiB
175 lines
12 KiB
/*
|
|
* 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.
|
|
*
|
|
* OpenAPI spec version: 1.3.4
|
|
*
|
|
* 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 ParticipationsFormationsApiController : ControllerBase
|
|
{
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <remarks>Consulter une évaluation d'une formation</remarks>
|
|
/// <param name="idParticipationFormation">id participation formation</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/evaluations/participationformation/{idParticipationFormation}")]
|
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("ConsulterEvaluation")]
|
|
[SwaggerResponse(statusCode: 200, type: typeof(EvaluationDTO), 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")]
|
|
public virtual IActionResult ConsulterEvaluation([FromRoute][Required]long? idParticipationFormation)
|
|
{
|
|
//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(EvaluationDTO));
|
|
|
|
//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;
|
|
exampleJson = "{\n \"idParticipation\" : 0,\n \"saisies\" : [ {\n \"note\" : 7,\n \"texte2\" : \"texte2\",\n \"texte\" : \"texte\",\n \"id\" : \"id\",\n \"champ\" : {\n \"typeChamp\" : \"typeChamp\",\n \"ordre\" : 5,\n \"texte\" : \"texte\",\n \"section\" : \"section\",\n \"soussection\" : \"soussection\",\n \"id\" : 4,\n \"typeSaisie\" : \"typeSaisie\"\n },\n \"typeSaisie\" : 6,\n \"niveau\" : 1\n }, {\n \"note\" : 7,\n \"texte2\" : \"texte2\",\n \"texte\" : \"texte\",\n \"id\" : \"id\",\n \"champ\" : {\n \"typeChamp\" : \"typeChamp\",\n \"ordre\" : 5,\n \"texte\" : \"texte\",\n \"section\" : \"section\",\n \"soussection\" : \"soussection\",\n \"id\" : 4,\n \"typeSaisie\" : \"typeSaisie\"\n },\n \"typeSaisie\" : 6,\n \"niveau\" : 1\n } ]\n}";
|
|
|
|
var example = exampleJson != null
|
|
? JsonConvert.DeserializeObject<EvaluationDTO>(exampleJson)
|
|
: default(EvaluationDTO); //TODO: Change the data returned
|
|
return new ObjectResult(example);
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <remarks>Evaluer une formation</remarks>
|
|
/// <param name="body"></param>
|
|
/// <param name="idParticipationFormation">id participation formation</param>
|
|
/// <response code="200">Evaluation envoyée avec succès</response>
|
|
/// <response code="403">Acces interdit</response>
|
|
/// <response code="404">Ressource n'a pas été trouvée</response>
|
|
[HttpPut]
|
|
[Route("/api/evaluations/participationformation/{idParticipationFormation}/evaluer")]
|
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("EvaluerFormation")]
|
|
[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 EvaluerFormation([FromBody]EvaluationDTO body, [FromRoute][Required]long? idParticipationFormation)
|
|
{
|
|
//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>Récupérer la liste des formations auxquelles est inscrit le collaborateur</remarks>
|
|
/// <param name="asc">Préciser si les données sont dans l'ordre (true) ou dans l'ordre inverse (false)</param>
|
|
/// <param name="idCollaborateur">id collaborateur</param>
|
|
/// <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="texte">Texte permettant d'identifier l'objet rechercher</param>
|
|
/// <param name="tri">Colonne du tableau sur lequel le tri s'effectue</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/participationsformation/collaborateur/{idCollaborateur}")]
|
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("GetParticipationByCollaborateur")]
|
|
[SwaggerResponse(statusCode: 200, type: typeof(List<ParticipationFormationDTO>), 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")]
|
|
public virtual IActionResult GetParticipationByCollaborateur([FromQuery][Required()]bool? asc, [FromRoute][Required]Guid? idCollaborateur, [FromQuery][Required()]int? numPage, [FromQuery][Required()]int? parPAge, [FromQuery]string texte, [FromQuery]string tri)
|
|
{
|
|
//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<ParticipationFormationDTO>));
|
|
|
|
//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;
|
|
exampleJson = "[ {\n \"date\" : \"2000-01-23T04:56:07.000+00:00\",\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"estEvaluee\" : true,\n \"dateCreation\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"formation\" : \"formation\",\n \"collaborateur\" : \"collaborateur\",\n \"statut\" : \"statut\"\n}, {\n \"date\" : \"2000-01-23T04:56:07.000+00:00\",\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"estEvaluee\" : true,\n \"dateCreation\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"formation\" : \"formation\",\n \"collaborateur\" : \"collaborateur\",\n \"statut\" : \"statut\"\n} ]";
|
|
|
|
var example = exampleJson != null
|
|
? JsonConvert.DeserializeObject<List<ParticipationFormationDTO>>(exampleJson)
|
|
: default(List<ParticipationFormationDTO>); //TODO: Change the data returned
|
|
return new ObjectResult(example);
|
|
}
|
|
|
|
/// <summary>
|
|
///
|
|
/// </summary>
|
|
/// <remarks>Récupérer la liste des participants d'une formation</remarks>
|
|
/// <param name="asc">Préciser si les données sont dans l'ordre (true) ou dans l'ordre inverse (false)</param>
|
|
/// <param name="idFormation">id formation</param>
|
|
/// <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="texte">Texte permettant d'identifier l'objet rechercher</param>
|
|
/// <param name="tri">Colonne du tableau sur lequel le tri s'effectue</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/participationsformation/formation/{idFormation}")]
|
|
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
|
|
[ValidateModelState]
|
|
[SwaggerOperation("GetParticipationByFormation")]
|
|
[SwaggerResponse(statusCode: 200, type: typeof(List<ParticipationFormationDTO>), 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")]
|
|
public virtual IActionResult GetParticipationByFormation([FromQuery][Required()]bool? asc, [FromRoute][Required]long? idFormation, [FromQuery][Required()]int? numPage, [FromQuery][Required()]int? parPAge, [FromQuery]string texte, [FromQuery]string tri)
|
|
{
|
|
//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<ParticipationFormationDTO>));
|
|
|
|
//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;
|
|
exampleJson = "[ {\n \"date\" : \"2000-01-23T04:56:07.000+00:00\",\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"estEvaluee\" : true,\n \"dateCreation\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"formation\" : \"formation\",\n \"collaborateur\" : \"collaborateur\",\n \"statut\" : \"statut\"\n}, {\n \"date\" : \"2000-01-23T04:56:07.000+00:00\",\n \"idCollaborateur\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"estEvaluee\" : true,\n \"dateCreation\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0,\n \"formation\" : \"formation\",\n \"collaborateur\" : \"collaborateur\",\n \"statut\" : \"statut\"\n} ]";
|
|
|
|
var example = exampleJson != null
|
|
? JsonConvert.DeserializeObject<List<ParticipationFormationDTO>>(exampleJson)
|
|
: default(List<ParticipationFormationDTO>); //TODO: Change the data returned
|
|
return new ObjectResult(example);
|
|
}
|
|
}
|
|
}
|
|
|