Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Add warning label [Issue #3] #12

Merged
merged 4 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void defaultResponse(HttpServletResponse response) throws Exception {
@GetMapping("/datapoints")
@ResponseBody
public List<Datapoint> getDataPoints() {
return aphelionService.getDataPoints();
return aphelionService.getDataPoints(null);
}

@GetMapping("/datapoints/health")
Expand Down Expand Up @@ -148,6 +148,24 @@ public List<Checkbox> getRegionsQuery() {
return aphelionService.getAllRegions();
}

@GetMapping("/datapoints/source/{key}/metadata/**")
@ResponseBody
public Metadata getSourceMetadata() {
return aphelionService.getAllSourceFilesMetadata();
}

@GetMapping("/datapoints/source/sampledata")
@ResponseBody
public List<Checkbox> getSource() {
return aphelionService.getAllSourceFiles();
}

@PostMapping("/datapoints/source/{key}/query/**")
@ResponseBody
public List<Checkbox> getSourceQuery() {
return aphelionService.getAllSourceFiles();
}

@GetMapping("/datapoints/barchart/health")
@ResponseBody
public String getBarchartHealth() {
Expand All @@ -173,9 +191,14 @@ public BarChart getBarChartQuery(@RequestBody JsonNode parameters) {
}

@GetMapping(value = "/datapoints/csv", produces = "text/csv")
public FileSystemResource getCsv(HttpServletResponse response){
FileSystemResource csv = new FileSystemResource(csvService.getLatestCSVFileName());
response.setHeader("Content-Disposition", "attachment; filename="+csv.getFilename());
return csv;
public FileSystemResource getCsv(@RequestParam(value = "source", required = false) String source, HttpServletResponse response){

try {
FileSystemResource csv = new FileSystemResource(csvService.getLatestCSVFileName(source));
response.setHeader("Content-Disposition", "attachment; filename=" + csv.getFilename());
return csv;
} catch (Exception e){
return null;
}
}
}
Loading