Skip to content

Commit 4f4a9d7

Browse files
committed
test: add new endpoint for testing purpose
1 parent d5e5464 commit 4f4a9d7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/main/java/fr/insee/genesis/controller/rest/responses/RawResponseController.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ public ResponseEntity<String> saveRawResponsesFromJsonBodyWithValidationDeprecat
147147

148148
@Operation(summary = "Save lunatic json data from one interrogation in Genesis Database (with json " +
149149
"schema validation)")
150-
@PutMapping(path="/raw-responses")
150+
@PostMapping(path="/raw-responses")
151151
@PreAuthorize("hasRole('COLLECT_PLATFORM')")
152152
public ResponseEntity<String> saveRawResponsesFromJsonBodyWithValidation(
153153
@RequestBody Map<String, Object> body
@@ -174,6 +174,17 @@ public ResponseEntity<String> saveRawResponsesFromJsonBodyWithValidation(
174174
return ResponseEntity.ok("Change this when ready");
175175
}
176176

177+
@Operation(summary = "Save lunatic json data from one interrogation in Genesis Database (with json " +
178+
"schema validation)")
179+
@PostMapping(path="/raw-responses/dto")
180+
@PreAuthorize("hasRole('COLLECT_PLATFORM')")
181+
public ResponseEntity<String> saveRawResponsesFromRawResponseDto(
182+
@RequestBody RawResponseDto dto
183+
) {
184+
rawRepository.saveAsRawJson(dto);
185+
return ResponseEntity.ok("Change this when ready");
186+
}
187+
177188
//GET unprocessed
178189
@Operation(summary = "Get campaign id and interrogationId from all unprocessed raw json data")
179190
@GetMapping(path = "/responses/raw/lunatic-json/get/unprocessed")

0 commit comments

Comments
 (0)