diff --git a/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java b/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java index c26201c7f797f1dad43c4f341cb4342ad754bfb0..0a321c31066e7d261563c5e4585d126374cfaeed 100644 --- a/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java +++ b/fda-query-service/rest-service/src/main/java/at/tuwien/endpoint/QueryEndpoint.java @@ -39,7 +39,6 @@ public class QueryEndpoint { this.storeService = storeService; } - @Deprecated @PutMapping @Transactional @PreAuthorize("hasRole('ROLE_RESEARCHER')") @@ -61,36 +60,12 @@ public class QueryEndpoint { log.error("Query is empty"); throw new QueryMalformedException("Invalid query"); } - if (data.getTables().size() == 0) { - log.error("Table list is empty"); - throw new QueryMalformedException("Invalid table"); - } log.debug("Data for execution: {}", data); final QueryResultDto result = queryService.execute(id, databaseId, data, page, size); return ResponseEntity.status(HttpStatus.ACCEPTED) .body(result); } - @PostMapping - @Transactional - @PreAuthorize("hasRole('ROLE_RESEARCHER')") - @ApiOperation(value = "saves a query without execution") - @ApiResponses(value = { - @ApiResponse(code = 200, message = "Executed the query, Saved it and return the results"), - @ApiResponse(code = 404, message = "The database does not exist."), - @ApiResponse(code = 405, message = "The container is not running."), - @ApiResponse(code = 409, message = "The container image is not supported."),}) - public ResponseEntity<QueryDto> save(@NotNull @PathVariable("id") Long id, - @NotNull @PathVariable("databaseId") Long databaseId, - @Valid @RequestBody SaveStatementDto data) - throws DatabaseNotFoundException, ImageNotSupportedException, QueryStoreException, - ContainerNotFoundException { - final Query query = storeService.insert(id, databaseId, null, data); - final QueryDto queryDto = queryMapper.queryToQueryDto(query); - return ResponseEntity.status(HttpStatus.ACCEPTED) - .body(queryDto); - } - @PutMapping("/{queryId}") @Transactional @PreAuthorize("hasRole('ROLE_RESEARCHER')")