From 22447ce3097517e92fb925d45f387ee626c4efa0 Mon Sep 17 00:00:00 2001 From: "gwenael.planchon" Date: Wed, 27 Mar 2024 16:20:03 +0100 Subject: [PATCH] ajouter le JSON de reference de chaque objet --- science-quest/src/data/scientifique.js | 136 ++++++++++++++++++++++++- science-quest/src/data/utilisateur.js | 11 +- 2 files changed, 145 insertions(+), 2 deletions(-) diff --git a/science-quest/src/data/scientifique.js b/science-quest/src/data/scientifique.js index e7a15a9..a62bc7c 100644 --- a/science-quest/src/data/scientifique.js +++ b/science-quest/src/data/scientifique.js @@ -41,4 +41,138 @@ export class ScientifiqueIndices extends PagedDataObject{ const response = await fetch(`${REST_API}/scientifiques/${idScientifique}/indices`) return new this(await response.json()) } -} \ No newline at end of file +} + +/* JSON de reference (Scientifique) +{ + "id" : 1, + "difficulte" : { + "id" : 1, + "libelle" : "Facile" + }, + "thematique" : { + "id" : 1, + "libelle" : "Nucléaire" + }, + "pathToPhoto" : "", + "nom" : "Marie", + "prenom" : "Curie", + "descriptif" : "desc", + "dateNaissance" : "2024-03-01T00:00:00.000+00:00", + "sexe" : "F", + "ratioTrouve" : 0.5, + "_links" : { + "indices" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques/1/indices" + }, + "self" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques/1" + } + } +} + +*/ + +/* JSON de reference (Scientifiques / Page de scientifiques) + +{ + "_links" : { + "first" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques?page=0&size=2" + }, + "self" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques?page=0&size=2" + }, + "next" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques?page=1&size=2" + }, + "last" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques?page=1&size=2" + } + }, + "page" : { + "size" : 2, + "totalElements" : 3, + "totalPages" : 2, + "number" : 0 + }, + "_embedded" : [ { + "id" : 1, + "difficulte" : { + "id" : 1, + "libelle" : "Facile" + }, + "thematique" : { + "id" : 1, + "libelle" : "Nucléaire" + }, + "pathToPhoto" : "", + "nom" : "Marie", + "prenom" : "Curie", + "descriptif" : "desc", + "dateNaissance" : "2024-03-01T00:00:00.000+00:00", + "sexe" : "F", + "ratioTrouve" : 0.5, + "_links" : { + "indices" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques/1/indices" + }, + "self" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques/1" + } + } + }, { + "id" : 2, + "difficulte" : { + "id" : 1, + "libelle" : "Facile" + }, + "thematique" : { + "id" : 2, + "libelle" : "Mathématiques" + }, + "pathToPhoto" : "", + "nom" : "Albert", + "prenom" : "Einstein", + "descriptif" : "desc", + "dateNaissance" : "2024-03-01T00:00:00.000+00:00", + "sexe" : "H", + "ratioTrouve" : 0.754, + "_links" : { + "indices" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques/2/indices" + }, + "self" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques/2" + } + } + } ] +} + +*/ + +/* JSON de reference (ScientifiqueIndices) + +{ + "_links" : { + "self" : { + "href" : "http://sae-java.alix-jdlm.fr/api/v1/scientifiques/1/indices" + } + }, + "_embedded" : [ { + "id" : 1, + "libelle" : "Indice pour aider", + "scientifique" : { + "id" : 1 + } + }, { + "id" : 2, + "libelle" : "S'appelle Marie", + "scientifique" : { + "id" : 1 + } + } ] +} + + +*/ \ No newline at end of file diff --git a/science-quest/src/data/utilisateur.js b/science-quest/src/data/utilisateur.js index 6b3fdcf..ac7111b 100644 --- a/science-quest/src/data/utilisateur.js +++ b/science-quest/src/data/utilisateur.js @@ -21,4 +21,13 @@ export class Utilisateur extends DataObject{ const response = await fetch(`${REST_API}/utilisateur/connexion`, {method:"POST" ,headers:{"Content-Type":"application/json"}, body:this}) return new this(await response.json()) } -} \ No newline at end of file +} + +//TODO : JSON de reference pour le get + +/* JSON de reference (register) +{"email":"amogus@amog.us", "pseudo":"amogus", "motDePasse":"hunter2"} +*/ +/* JSON de reference (login) +{"email":"amogus@amog.us", "motDePasse":"hunter2"} +*/ \ No newline at end of file