use of py.org.fundacionparaguaya.pspserver.surveys.dtos.NewSnapshot in project FP-PSP-SERVER by FundacionParaguaya.
the class SnapshotController method addSnapshot.
@PostMapping(consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
@io.swagger.annotations.ApiOperation(value = "Create Snapshot", notes = "A `POST` request will create new snapshot for a particular survey.", response = Snapshot.class, tags = {})
@io.swagger.annotations.ApiResponses(value = { @io.swagger.annotations.ApiResponse(code = 201, message = "The created snapshot", response = Snapshot.class) })
public ResponseEntity addSnapshot(@AuthenticationPrincipal UserDetailsDTO details, @ApiParam(value = "The snapshot", required = true) @RequestBody NewSnapshot snapshot) throws NotFoundException, URISyntaxException {
LOG.debug("REST request to add Snapshot : {}", snapshot);
Snapshot data = snapshotService.addSurveySnapshot(details, snapshot);
URI surveyLocation = new URI("/snapshots/" + data.getSurveyId());
return ResponseEntity.created(surveyLocation).body(data);
}
Aggregations