Skip to content

Commit

Permalink
adjustments for ludum dare game beerloose
Browse files Browse the repository at this point in the history
  • Loading branch information
lenzls committed Apr 20, 2020
1 parent 08860b5 commit 72e5907
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ private String getAbsoluteFilePath() {
*/
@GetMapping(value = "/submit-statistics", produces = "application/json")
@CrossOrigin(origins = "*") // Shouldn't be needed, but adding it just in case…
public Map<String, Object> submitStatisticsViaGET(@RequestParam Map<String, Object> queryParameters) {
public Object submitStatisticsViaGET(@RequestParam Map<String, Object> queryParameters) {
GlobalWrapper statistics = updateStatisticsWithIncomingData(queryParameters);
return processStatistics(statistics);
return gson.toJson(statistics);
}

@PostMapping(value = "/submit-statistics", produces = "application/json")
@CrossOrigin(origins = "*")
public Map<String, Object> submitStatisticsViaPOST(@RequestBody Map<String, Object> data) {
public Object submitStatisticsViaPOST(@RequestBody Map<String, Object> data) {
GlobalWrapper statistics = updateStatisticsWithIncomingData(data);
return processStatistics(statistics);
return gson.toJson(statistics);
}

private Map<String, Object> processStatistics(GlobalWrapper statistics) {
Expand Down

0 comments on commit 72e5907

Please sign in to comment.