From 6b8f84a262e35c410a3fe61eb408315577669af6 Mon Sep 17 00:00:00 2001 From: Georg Reisinger Date: Wed, 30 Dec 2020 15:14:31 +0100 Subject: [PATCH] getTradingDeals /tradings --- .../java/at/reisinger/server/objects/Response.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/at/reisinger/server/objects/Response.java b/src/main/java/at/reisinger/server/objects/Response.java index b99c93e..4e53286 100644 --- a/src/main/java/at/reisinger/server/objects/Response.java +++ b/src/main/java/at/reisinger/server/objects/Response.java @@ -129,6 +129,20 @@ public class Response { } else { sendError("500"); } + }else if(this.url.startsWith("/tradings")) { + ArrayList allDeals = new DBConnection().getAllTradingDeals(); + if(allDeals != null && !allDeals.isEmpty()){ + String json = JsonHelper.objToJson(allDeals); + if(json != null && json != ""){ + sendResponse(json, "200"); + }else{ + sendError("500"); + } + }else{ + sendError("500"); + } + }else{ + sendError("204"); } }