From 4f7f9d5ab6a7db38756325cbe0e7276ee619e1e7 Mon Sep 17 00:00:00 2001 From: Hugo Bouttes Date: Tue, 5 Dec 2023 09:08:00 +0100 Subject: [PATCH 1/8] feat : add withCodes queryparameter for GET /listeCode/{id} --- .../rmes/controller/CodeListsResources.java | 16 +++++++++++++--- .../rmes/services/codelists/CodeListImpl.java | 18 ++++++++++++++++++ .../services/codelists/CodeListsServices.java | 2 ++ 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java index 21d8dc73..060eed49 100644 --- a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java +++ b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java @@ -58,18 +58,28 @@ public ResponseEntity getallCodesLists() throws RmesException { @Operation(operationId = "getCodesList", summary = "Get one codes list", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) public ResponseEntity getCodesList( @PathVariable(Constants.NOTATION) String notation, - @RequestParam(name = "dateMiseAJour", defaultValue = "false") Boolean boolDateMiseAJour + @RequestParam(name = "dateMiseAJour", defaultValue = "false") Boolean boolDateMiseAJour, + @RequestParam(value="withCodes", defaultValue = "true") + boolean withCodes ) throws RmesException { + if (!withCodes){ + String jsonResult = codeListsServices.getCodesListWithoutCodes(notation); + if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { + return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build(); + } else { + return ResponseEntity.status(HttpStatus.SC_OK).body(jsonResult); + } + } if (!boolDateMiseAJour) { String jsonResult = codeListsServices.getCodesList(notation); if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build(); } else { - return ResponseEntity.status(HttpStatus.SC_OK).body(jsonResult); } - } else { + } + else { String jsonResult = codeListsServices.getCodesListDateMiseAJour(notation); if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build(); diff --git a/src/main/java/fr/insee/rmes/services/codelists/CodeListImpl.java b/src/main/java/fr/insee/rmes/services/codelists/CodeListImpl.java index 0bb77fab..66b271fd 100644 --- a/src/main/java/fr/insee/rmes/services/codelists/CodeListImpl.java +++ b/src/main/java/fr/insee/rmes/services/codelists/CodeListImpl.java @@ -258,6 +258,24 @@ public Integer getMaxpage(String notation) throws RmesException { } return total; } + + public String getCodesListWithoutCodes(String notation) throws RmesException{ + + Map params = initParamsNotation(notation); + + JSONObject codesList = repoGestion.getResponseAsObject(buildRequest(Constants.CODELISTS_QUERIES_PATH,"getCodesList.ftlh", params)); + + codesList.put("label", this.formatLabel(codesList)); + codesList.remove("prefLabelLg1"); + codesList.remove("prefLabelLg2"); + + if(codesList.has(STATUT_VALIDATION)){ + String validationState = codesList.getString(STATUT_VALIDATION); + codesList.put(STATUT_VALIDATION, this.getValidationState(validationState)); + } + codesList.remove(Constants.URI); + return codesList.toString(); + } public String getCodesListPagination(String notation, int pageNumber)throws RmesException{ Map params = initParamsNotation(notation); JSONObject result = repoGestion.getResponseAsObject(buildRequest(Constants.CODELISTS_QUERIES_PATH,"getCodesList.ftlh",params)); diff --git a/src/main/java/fr/insee/rmes/services/codelists/CodeListsServices.java b/src/main/java/fr/insee/rmes/services/codelists/CodeListsServices.java index e421b044..e25058ee 100644 --- a/src/main/java/fr/insee/rmes/services/codelists/CodeListsServices.java +++ b/src/main/java/fr/insee/rmes/services/codelists/CodeListsServices.java @@ -17,4 +17,6 @@ public interface CodeListsServices { Integer getMaxpage(String notation) throws RmesException; String getCodesListPagination(String notation, int pageNumber) throws RmesException; + + String getCodesListWithoutCodes(String notation) throws RmesException; } From 629f2940bf73dfdc798c3d42e774e294af66decd Mon Sep 17 00:00:00 2001 From: Hugo Bouttes Date: Tue, 9 Jan 2024 10:12:26 +0100 Subject: [PATCH 2/8] fix : add another method mapping request withCodes parameter --- .../rmes/controller/CodeListsResources.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java index 060eed49..c43a93e5 100644 --- a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java +++ b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java @@ -58,19 +58,9 @@ public ResponseEntity getallCodesLists() throws RmesException { @Operation(operationId = "getCodesList", summary = "Get one codes list", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) public ResponseEntity getCodesList( @PathVariable(Constants.NOTATION) String notation, - @RequestParam(name = "dateMiseAJour", defaultValue = "false") Boolean boolDateMiseAJour, - @RequestParam(value="withCodes", defaultValue = "true") - boolean withCodes + @RequestParam(name = "dateMiseAJour", defaultValue = "false") Boolean boolDateMiseAJour ) throws RmesException { - if (!withCodes){ - String jsonResult = codeListsServices.getCodesListWithoutCodes(notation); - if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { - return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build(); - } else { - return ResponseEntity.status(HttpStatus.SC_OK).body(jsonResult); - } - } if (!boolDateMiseAJour) { String jsonResult = codeListsServices.getCodesList(notation); if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { @@ -80,16 +70,28 @@ public ResponseEntity getCodesList( } } else { - String jsonResult = codeListsServices.getCodesListDateMiseAJour(notation); + String jsonResult = codeListsServices.getCodesListWithoutCodes(notation); if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build(); } else { - return ResponseEntity.status(HttpStatus.SC_OK).body(jsonResult); } } } + @GetMapping("/listeCode/{id}/withCodes") + @Produces(MediaType.APPLICATION_JSON) + @Operation(operationId = "getCodesListWithCodes", summary = "Get one codes list with or without codes", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) + public ResponseEntity getCodesListWithCodes( + @PathVariable(Constants.NOTATION) String notation) throws RmesException { + String jsonResult = codeListsServices.getCodesListDateMiseAJour(notation); + if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { + return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build(); + } else { + return ResponseEntity.status(HttpStatus.SC_OK).body(jsonResult); + } + } + @GetMapping("/listeCode/{id}/pagination") @Produces(MediaType.APPLICATION_JSON) From 6afd82d6ac04c92146b1dd131bd03654bf45d72a Mon Sep 17 00:00:00 2001 From: Hugo Bouttes Date: Tue, 9 Jan 2024 10:18:26 +0100 Subject: [PATCH 3/8] fix : factorization of code --- .../rmes/services/codelists/CodeListImpl.java | 10 ++++------ .../rmes/services/structures/StructuresImpl.java | 8 ++++---- .../insee/rmes/services/utils/CommonMethods.java | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 src/main/java/fr/insee/rmes/services/utils/CommonMethods.java diff --git a/src/main/java/fr/insee/rmes/services/codelists/CodeListImpl.java b/src/main/java/fr/insee/rmes/services/codelists/CodeListImpl.java index 66b271fd..932ed59f 100644 --- a/src/main/java/fr/insee/rmes/services/codelists/CodeListImpl.java +++ b/src/main/java/fr/insee/rmes/services/codelists/CodeListImpl.java @@ -1,6 +1,7 @@ package fr.insee.rmes.services.codelists; import fr.insee.rmes.persistence.RdfService; +import fr.insee.rmes.services.utils.CommonMethods; import fr.insee.rmes.utils.Constants; import fr.insee.rmes.utils.config.Config; import fr.insee.rmes.utils.exceptions.RmesException; @@ -44,8 +45,7 @@ public String getCodesList(String notation) throws RmesException { JSONObject codesList = repoGestion.getResponseAsObject(buildRequest(Constants.CODELISTS_QUERIES_PATH,"getCodesList.ftlh", params)); codesList.put("label", this.formatLabel(codesList)); - codesList.remove("prefLabelLg1"); - codesList.remove("prefLabelLg2"); + CommonMethods.removePrefLabels(codesList); if(codesList.has(STATUT_VALIDATION)){ String validationState = codesList.getString(STATUT_VALIDATION); @@ -266,8 +266,7 @@ public String getCodesListWithoutCodes(String notation) throws RmesException{ JSONObject codesList = repoGestion.getResponseAsObject(buildRequest(Constants.CODELISTS_QUERIES_PATH,"getCodesList.ftlh", params)); codesList.put("label", this.formatLabel(codesList)); - codesList.remove("prefLabelLg1"); - codesList.remove("prefLabelLg2"); + CommonMethods.removePrefLabels(codesList); if(codesList.has(STATUT_VALIDATION)){ String validationState = codesList.getString(STATUT_VALIDATION); @@ -280,8 +279,7 @@ public String getCodesListPagination(String notation, int pageNumber)throws Rmes Map params = initParamsNotation(notation); JSONObject result = repoGestion.getResponseAsObject(buildRequest(Constants.CODELISTS_QUERIES_PATH,"getCodesList.ftlh",params)); result.put("label", this.formatLabel(result)); - result.remove("prefLabelLg1"); - result.remove("prefLabelLg2"); + CommonMethods.removePrefLabels(result); if(result.has(STATUT_VALIDATION)){ String validationState = result.getString(STATUT_VALIDATION); result.put(STATUT_VALIDATION, this.getValidationState(validationState)); diff --git a/src/main/java/fr/insee/rmes/services/structures/StructuresImpl.java b/src/main/java/fr/insee/rmes/services/structures/StructuresImpl.java index fe1ac7d2..3e285a58 100644 --- a/src/main/java/fr/insee/rmes/services/structures/StructuresImpl.java +++ b/src/main/java/fr/insee/rmes/services/structures/StructuresImpl.java @@ -7,6 +7,7 @@ import fr.insee.rmes.persistence.RdfService; import fr.insee.rmes.persistence.ontologies.IGEO; import fr.insee.rmes.persistence.ontologies.QB; +import fr.insee.rmes.services.utils.CommonMethods; import fr.insee.rmes.utils.Constants; import fr.insee.rmes.utils.config.Config; import fr.insee.rmes.utils.exceptions.RmesException; @@ -80,8 +81,7 @@ public String getStructure(String id) throws RmesException, JsonProcessingExcept JSONObject structure = (JSONObject) structureArray.get(0); structure.put(LABEL, this.formatLabel(structure)); - structure.remove("prefLabelLg1"); - structure.remove("prefLabelLg2"); + CommonMethods.removePrefLabels(structure); if(structureArray.length() > 1){ @@ -240,8 +240,8 @@ public JSONObject getComponent(String id) throws RmesException { component.put(NOM,this.formatNom(component)); component.remove("altLabelLg1"); component.remove("altLabelLg2"); - component.remove("prefLabelLg1"); - component.remove("prefLabelLg2"); + CommonMethods.removePrefLabels(component); + if(component.has(URI_COMPONENT_PARENT_ID)){ JSONObject parent = new JSONObject(); diff --git a/src/main/java/fr/insee/rmes/services/utils/CommonMethods.java b/src/main/java/fr/insee/rmes/services/utils/CommonMethods.java new file mode 100644 index 00000000..2a2f5409 --- /dev/null +++ b/src/main/java/fr/insee/rmes/services/utils/CommonMethods.java @@ -0,0 +1,14 @@ +package fr.insee.rmes.services.utils; + +import org.json.JSONObject; + +public class CommonMethods { + + + public static void removePrefLabels(JSONObject jsonObject){ + if (jsonObject.has("prefLabelLg1") && jsonObject.has("prefLabelLg2")){ + jsonObject.remove("prefLabelLg1"); + jsonObject.remove("prefLabelLg2"); + } + } +} From ad29cd78c1f92a09c7df52f41551016684c84a73 Mon Sep 17 00:00:00 2001 From: Hugo Bouttes Date: Tue, 9 Jan 2024 10:21:50 +0100 Subject: [PATCH 4/8] feat : add Banner.txt for Magma --- src/main/resources/banner.txt | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/main/resources/banner.txt diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt new file mode 100644 index 00000000..0e6e70f7 --- /dev/null +++ b/src/main/resources/banner.txt @@ -0,0 +1,8 @@ + __ __ + | \/ | + | \ / | __ _ __ _ _ __ ___ __ _ + | |\/| |/ _` |/ _` | '_ ` _ \ / _` | + | | | | (_| | (_| | | | | | | (_| | + |_| |_|\__,_|\__, |_| |_| |_|\__,_| + __/ | + |___/ \ No newline at end of file From 5f70f74c212cd8cfe68cc9edb2f3aacb1ed1b0c0 Mon Sep 17 00:00:00 2001 From: Hugo Bouttes Date: Tue, 9 Jan 2024 15:18:50 +0100 Subject: [PATCH 5/8] fix : change name --- .../fr/insee/rmes/controller/CodeListsResources.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java index c43a93e5..4b8ad61f 100644 --- a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java +++ b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java @@ -70,7 +70,7 @@ public ResponseEntity getCodesList( } } else { - String jsonResult = codeListsServices.getCodesListWithoutCodes(notation); + String jsonResult = codeListsServices.getCodesListDateMiseAJour(notation); if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build(); } else { @@ -79,12 +79,12 @@ public ResponseEntity getCodesList( } } - @GetMapping("/listeCode/{id}/withCodes") + @GetMapping("/listeCode/{id}/withoutCodes") @Produces(MediaType.APPLICATION_JSON) - @Operation(operationId = "getCodesListWithCodes", summary = "Get one codes list with or without codes", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) - public ResponseEntity getCodesListWithCodes( + @Operation(operationId = "getCodesListWithCodes", summary = "Get one codes list without codes", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) + public ResponseEntity getCodesListWithoutCodes( @PathVariable(Constants.NOTATION) String notation) throws RmesException { - String jsonResult = codeListsServices.getCodesListDateMiseAJour(notation); + String jsonResult = codeListsServices.getCodesListWithoutCodes(notation); if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build(); } else { From f04db0a9b7981565968a3ec1b3a35e4167fe717a Mon Sep 17 00:00:00 2001 From: Hugo Bouttes Date: Tue, 9 Jan 2024 15:22:49 +0100 Subject: [PATCH 6/8] feat : add test for getCodesListWithoutCodes --- .../services/codelists/CodeListImplTest.java | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/test/java/fr/insee/rmes/services/codelists/CodeListImplTest.java diff --git a/src/test/java/fr/insee/rmes/services/codelists/CodeListImplTest.java b/src/test/java/fr/insee/rmes/services/codelists/CodeListImplTest.java new file mode 100644 index 00000000..37eada5c --- /dev/null +++ b/src/test/java/fr/insee/rmes/services/codelists/CodeListImplTest.java @@ -0,0 +1,60 @@ +package fr.insee.rmes.services.codelists; + +import fr.insee.rmes.persistence.RdfService; +import fr.insee.rmes.services.utils.CommonMethods; +import fr.insee.rmes.utils.Constants; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +import org.junit.jupiter.api.Test; + +import java.util.Map; + +import static fr.insee.rmes.utils.Constants.STATUT_VALIDATION; +import static org.junit.jupiter.api.Assertions.*; + +class CodeListImplTest { + + public static final String CODELIST_TEST_WITH_STATUT_VALIDATION = "{\"dateMiseAJour\":\"2023-01-01T00:00:00\",\"dateCreation\":\"2023-01-01T00:00:00\",\"statutValidation\":\"Provisoire, jamais publiée\",\"id\":\"CL_TEST\"}"; + public static final String CODELIST_TEST_WITHOUT_STATUT_VALIDATION = "{\"dateMiseAJour\":\"2023-01-01T00:00:00\",\"dateCreation\":\"2023-01-01T00:00:00\",\"id\":\"CL_TEST\"}"; + + + public static final String LABEL = "[{\"langue\":\"fr\",\"contenu\":\"test\"},{\"langue\":\"en\",\"contenu\":\"test\"}]"; + public static final String CODELIST_EXPECTED_WITH_STATUT_VALIDATION = "{\"dateMiseAJour\":\"2023-01-01T00:00:00\",\"dateCreation\":\"2023-01-01T00:00:00\",\"statutValidation\":\"Provisoire, jamais publiée\",\"id\":\"CL_TEST\",\"label\":[{\"langue\":\"fr\",\"contenu\":\"test\"},{\"langue\":\"en\",\"contenu\":\"test\"}]}"; + public static final String CODELIST_EXPECTED_WITHOUT_STATUT_VALIDATION = "{\"dateMiseAJour\":\"2023-01-01T00:00:00\",\"dateCreation\":\"2023-01-01T00:00:00\",\"id\":\"CL_TEST\",\"label\":[{\"langue\":\"fr\",\"contenu\":\"test\"},{\"langue\":\"en\",\"contenu\":\"test\"}]}"; + + public static final String STATUT_VALIDATION_PUBLIEE = "Publiée"; + + @Test + void getCodesListWithoutCodes_With_Statut_Validation() throws JSONException { + + JSONObject codesList = new JSONObject(CODELIST_TEST_WITH_STATUT_VALIDATION); + JSONArray label = new JSONArray(LABEL); + codesList.put("label",label); + + if(codesList.has(STATUT_VALIDATION)){ + String validationState = codesList.getString(STATUT_VALIDATION); + codesList.put(STATUT_VALIDATION, validationState); + } + codesList.remove(Constants.URI); + assertTrue(codesList.toString().equals(CODELIST_EXPECTED_WITH_STATUT_VALIDATION)); + + } + + @Test + void getCodesListWithoutCodes_Without_Statut_Validation() throws JSONException { + + JSONObject codesList = new JSONObject(CODELIST_TEST_WITHOUT_STATUT_VALIDATION); + JSONArray label = new JSONArray(LABEL); + codesList.put("label",label); + + if(codesList.has(STATUT_VALIDATION)){ + String validationState = codesList.getString(STATUT_VALIDATION); + codesList.put(STATUT_VALIDATION, STATUT_VALIDATION_PUBLIEE); + } + codesList.remove(Constants.URI); + assertTrue(codesList.toString().equals(CODELIST_EXPECTED_WITHOUT_STATUT_VALIDATION)); + + } + +} \ No newline at end of file From 47ec55cdaeccb1280dbf8b89831198b9a8e882e0 Mon Sep 17 00:00:00 2001 From: Hugo Bouttes Date: Wed, 10 Jan 2024 13:34:57 +0100 Subject: [PATCH 7/8] fix : keep the same requestmapping --- .../java/fr/insee/rmes/controller/CodeListsResources.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java index 4b8ad61f..369b3b39 100644 --- a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java +++ b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java @@ -24,6 +24,8 @@ import java.util.List; import java.util.Objects; +import static org.springframework.web.bind.annotation.RequestMethod.GET; + @RestController @RequestMapping(value="/",produces = {"application/json"}) @Tag(name = "Codes lists", description = "Consultation Gestion API - listes des codes") @@ -53,7 +55,7 @@ public ResponseEntity getallCodesLists() throws RmesException { } // en fait ici l'id correspond à la notation - @GetMapping("/listeCode/{id}") + @RequestMapping(path="/listeCode/{id}", method=GET, params="withCodes=true") @Produces(MediaType.APPLICATION_JSON) @Operation(operationId = "getCodesList", summary = "Get one codes list", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) public ResponseEntity getCodesList( @@ -79,7 +81,7 @@ public ResponseEntity getCodesList( } } - @GetMapping("/listeCode/{id}/withoutCodes") + @RequestMapping(path="/listeCode/{id}", method=GET, params="withCodes=false") @Produces(MediaType.APPLICATION_JSON) @Operation(operationId = "getCodesListWithCodes", summary = "Get one codes list without codes", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) public ResponseEntity getCodesListWithoutCodes( From 936471f461265aa147150b76dfab9528dce36ffd Mon Sep 17 00:00:00 2001 From: Hugo Bouttes Date: Thu, 11 Jan 2024 13:44:43 +0100 Subject: [PATCH 8/8] fix : forget the @RequestParams withCodes for GET /listeCode/{id} --- .../fr/insee/rmes/controller/CodeListsResources.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java index 369b3b39..713f3267 100644 --- a/src/main/java/fr/insee/rmes/controller/CodeListsResources.java +++ b/src/main/java/fr/insee/rmes/controller/CodeListsResources.java @@ -60,7 +60,8 @@ public ResponseEntity getallCodesLists() throws RmesException { @Operation(operationId = "getCodesList", summary = "Get one codes list", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) public ResponseEntity getCodesList( @PathVariable(Constants.NOTATION) String notation, - @RequestParam(name = "dateMiseAJour", defaultValue = "false") Boolean boolDateMiseAJour + @RequestParam(name = "dateMiseAJour", defaultValue = "false") Boolean boolDateMiseAJour, + @RequestParam(name = "withCodes") Boolean boolWithCodes ) throws RmesException { if (!boolDateMiseAJour) { @@ -83,9 +84,11 @@ public ResponseEntity getCodesList( @RequestMapping(path="/listeCode/{id}", method=GET, params="withCodes=false") @Produces(MediaType.APPLICATION_JSON) - @Operation(operationId = "getCodesListWithCodes", summary = "Get one codes list without codes", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) + @Operation(operationId = "getCodesList", summary = "Get one codes list", security = @SecurityRequirement(name = "bearerScheme"), responses = {@ApiResponse(content = @Content(mediaType = "application/json", schema = @Schema(type = "array", implementation = ListCodeByIdModelSwagger.class)))}) public ResponseEntity getCodesListWithoutCodes( - @PathVariable(Constants.NOTATION) String notation) throws RmesException { + @PathVariable(Constants.NOTATION) String notation, + @RequestParam(name = "dateMiseAJour", defaultValue = "false") Boolean boolDateMiseAJour, + @RequestParam(name = "withCodes") Boolean boolWithCodes) throws RmesException { String jsonResult = codeListsServices.getCodesListWithoutCodes(notation); if (Objects.isNull(jsonResult) || StringUtils.isEmpty(jsonResult)) { return ResponseEntity.status(HttpStatus.SC_NOT_FOUND).build();