From 567be9b94f934d60fbd0f8604e4d0bfc99068ddd Mon Sep 17 00:00:00 2001 From: visoulier Date: Sun, 31 Mar 2024 19:13:29 +0200 Subject: [PATCH] ajout route status --- .../sae/controllers/PartieKahootController.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java index 82528fd..a408db7 100644 --- a/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java +++ b/SpringBootProject/src/main/java/fr/iut/sciencequest/sae/controllers/PartieKahootController.java @@ -115,6 +115,14 @@ public class PartieKahootController { return this.modelMapper.map(partieKahoot, PartieKahootStatusDTO.class); } + @GetMapping(value = "/{codeInvitation}/status", produces = MediaType.APPLICATION_JSON_VALUE) + @ResponseStatus(HttpStatus.OK) + public PartieKahootStatusDTO getStatusPartie(@PathVariable String codeInvitation){ + PartieKahoot partieKahoot = this.partieKahootService.getPartieKahootByIdOrCodeInvitation(codeInvitation); + partieKahoot = this.partieKahootService.maintenirAJourQuestionActuel(partieKahoot); + return this.modelMapper.map(partieKahoot, PartieKahootStatusDTO.class); + } + @GetMapping(value = "/{codeInvitation}/question", produces = MediaType.APPLICATION_JSON_VALUE) @ResponseStatus(HttpStatus.OK) public PartieKahootQuestionDTO getQuestionActuel(@PathVariable String codeInvitation){