|
31 | 31 | import fr.insee.genesis.exceptions.GenesisException; |
32 | 32 | import fr.insee.genesis.exceptions.NoDataException; |
33 | 33 | import fr.insee.genesis.infrastructure.utils.FileUtils; |
34 | | -import io.swagger.v3.oas.annotations.Hidden; |
35 | 34 | import io.swagger.v3.oas.annotations.Operation; |
36 | 35 | import io.swagger.v3.oas.annotations.tags.Tag; |
37 | 36 | import lombok.extern.slf4j.Slf4j; |
@@ -243,30 +242,6 @@ public ResponseEntity<Object> findResponsesByInterrogationAndQuestionnaireLatest |
243 | 242 | return ResponseEntity.ok(responseQualityToolDto); |
244 | 243 | } |
245 | 244 |
|
246 | | - @Hidden |
247 | | - @Operation(summary = "Retrieve all responses (for all interrogations) of one questionnaire") |
248 | | - @GetMapping(path = "/by-questionnaire") |
249 | | - @PreAuthorize("hasRole('ADMIN')") |
250 | | - public ResponseEntity<Path> findAllResponsesByQuestionnaire(@RequestParam("questionnaireId") String questionnaireId) { |
251 | | - log.info("Try to find all responses of questionnaire : {}", questionnaireId); |
252 | | - |
253 | | - //Get all interrogationIds/modes of the survey |
254 | | - List<SurveyUnitModel> interrogationIdsResponses = surveyUnitService.findInterrogationIdsAndModesByQuestionnaireId(questionnaireId); |
255 | | - log.info("Responses found : {}", interrogationIdsResponses.size()); |
256 | | - |
257 | | - String filepathString = String.format("OUT/%s/OUT_ALL_%s.json", questionnaireId, LocalDateTime.now().toString().replace(":", "")); |
258 | | - Path filepath = Path.of(fileUtils.getDataFolderSource(), filepathString); |
259 | | - |
260 | | - try (Stream<SurveyUnitModel> responsesStream = surveyUnitService.findByQuestionnaireId(questionnaireId)) { |
261 | | - fileUtils.writeSuUpdatesInFile(filepath, responsesStream); |
262 | | - } catch (IOException e) { |
263 | | - log.error("Error while writing file", e); |
264 | | - return ResponseEntity.internalServerError().body(filepath); |
265 | | - } |
266 | | - log.info("End of extraction, responses extracted: {}", interrogationIdsResponses.size()); |
267 | | - return ResponseEntity.ok(filepath); |
268 | | - } |
269 | | - |
270 | 245 | @Operation(summary = "Retrieve responses for an interrogation, using interrogationId and questionnaireId from Genesis Database. It returns only the latest value of each variable regardless of the state.") |
271 | 246 | @GetMapping(path = "/by-ue-and-questionnaire/latest") |
272 | 247 | @PreAuthorize("hasRole('ADMIN')") |
|
0 commit comments