Skip to content

Commit

Permalink
Merge pull request #12 from HBPMedical/dev-statistics-v2
Browse files Browse the repository at this point in the history
descriptive_stats_v2 method
  • Loading branch information
ThanKarab authored Jun 18, 2020
2 parents 0e3a23b + 83c8e06 commit eed9624
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/eu/hbp/mip/controllers/MiningApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,24 @@ public ResponseEntity runExaremeDescriptiveStats(@RequestBody List<HashMap<Strin
}
}

@ApiOperation(value = "Create a descriptive statistic on Exareme", response = String.class)
@RequestMapping(value = "/descriptive_stats_v2", method = RequestMethod.POST)
public ResponseEntity runExaremeDescriptiveStatsV2(@RequestBody List<HashMap<String, String>> queryList) {
UserActionLogging.LogUserAction(userInfo.getUser().getUsername(), "Run descriptive stats v2", "");

String query = gson.toJson(queryList);
String url = queryExaremeUrl + "/" + "DESCRIPTIVE_STATS_v2";

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);
}
}

@ApiOperation(value = "Check if a formula is valid", response = String.class)
@RequestMapping(value = "/checkFormula", method = RequestMethod.POST)
public ResponseEntity checkFormulaValidity(String formula) {
Expand Down

0 comments on commit eed9624

Please sign in to comment.