Skip to content
Snippets Groups Projects

UI sprint 2

17 files
+ 538
89
Compare changes
  • Side-by-side
  • Inline

Files

@@ -13,6 +13,7 @@ import at.tuwien.service.QueryService;
@@ -13,6 +13,7 @@ import at.tuwien.service.QueryService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import io.swagger.annotations.ApiResponses;
 
import net.sf.jsqlparser.JSQLParserException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.ResponseEntity;
@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response;
 
import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLSyntaxErrorException;
import java.sql.SQLSyntaxErrorException;
import java.util.List;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Collectors;
@@ -77,7 +79,7 @@ public class QueryEndpoint {
@@ -77,7 +79,7 @@ public class QueryEndpoint {
@ApiResponse(code = 404, message = "The database does not exist."),
@ApiResponse(code = 404, message = "The database does not exist."),
@ApiResponse(code = 405, message = "The container is not running."),
@ApiResponse(code = 405, message = "The container is not running."),
@ApiResponse(code = 409, message = "The container image is not supported."),})
@ApiResponse(code = 409, message = "The container image is not supported."),})
public Response modify(@PathVariable Long id, @RequestBody ExecuteQueryDTO dto) throws DatabaseNotFoundException, ImageNotSupportedException, SQLSyntaxErrorException {
public Response modify(@PathVariable Long id, @RequestBody ExecuteQueryDTO dto) throws DatabaseNotFoundException, ImageNotSupportedException, SQLSyntaxErrorException, JSQLParserException, SQLFeatureNotSupportedException {
QueryResult qr = queryService.executeStatement(id, queryMapper.queryDTOtoQuery(dto));
QueryResult qr = queryService.executeStatement(id, queryMapper.queryDTOtoQuery(dto));
return Response
return Response
@@ -90,7 +92,7 @@ public class QueryEndpoint {
@@ -90,7 +92,7 @@ public class QueryEndpoint {
@PutMapping("/query/version/{timestamp}")
@PutMapping("/query/version/{timestamp}")
@ApiOperation(value = "executes a query with a given timestamp")
@ApiOperation(value = "executes a query with a given timestamp")
@ApiResponses(value = {@ApiResponse(code = 201, message = "result of Query with Timestamp", response = Response.class)})
@ApiResponses(value = {@ApiResponse(code = 201, message = "result of Query with Timestamp", response = Response.class)})
public Response modify(@PathVariable Long id, @PathVariable String timestamp, @RequestBody ExecuteQueryDTO dto) throws DatabaseNotFoundException, ImageNotSupportedException, SQLSyntaxErrorException {
public Response modify(@PathVariable Long id, @PathVariable String timestamp, @RequestBody ExecuteQueryDTO dto) throws DatabaseNotFoundException, ImageNotSupportedException, SQLSyntaxErrorException, JSQLParserException, SQLFeatureNotSupportedException {
queryService.executeStatement(id, queryMapper.queryDTOtoQuery(dto));
queryService.executeStatement(id, queryMapper.queryDTOtoQuery(dto));
return Response
return Response
Loading