Skip to content
Snippets Groups Projects
Commit 9f05ff9a authored by ThanKarab's avatar ThanKarab
Browse files

Cleanup.

parent 734b67dd
No related branches found
No related tags found
1 merge request!8Dev merge middleware
/*
* Created by mirco on 04.12.15.
*/
package eu.hbp.mip.controllers;
import io.swagger.annotations.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
@RestController
@RequestMapping(value = "/datasets", produces = {APPLICATION_JSON_VALUE})
@Api(value = "/datasets", description = "the datasets API")
public class DatasetsApi {
private static final Logger LOGGER = LoggerFactory.getLogger(DatasetsApi.class);
}
......@@ -83,25 +83,4 @@ public class MiningApi {
return new ResponseEntity<>("Not found", HttpStatus.BAD_REQUEST);
}
}
@ApiOperation(value = "Perform an non persisted algorithm on Exareme", response = String.class)
@RequestMapping(value = "/exareme/{algorithmName}", method = RequestMethod.POST)
public ResponseEntity runExaremeAlgorithm(
@RequestBody List<HashMap<String, String>> queryList,
@ApiParam(value = "algorithmName", required = true) @PathVariable("algorithmName") String algorithmName
) {
UserActionLogging.LogAction("Run algo", "");
String query = gson.toJson(queryList);
String url = queryExaremeUrl + "/" + algorithmName;
try {
StringBuilder results = new StringBuilder();
int code = HTTPUtil.sendPost(url, query, results);
return ResponseEntity.ok(gson.toJson(results.toString()));
} catch (IOException e) {
return new ResponseEntity<>("Not found", HttpStatus.BAD_REQUEST);
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment