From 051c15d8d3df72d734f57bd19603e8644c161c45 Mon Sep 17 00:00:00 2001 From: Ivan Bogosavljevic Date: Wed, 17 Apr 2024 18:53:14 +0200 Subject: [PATCH] =?UTF-8?q?B=C3=B6rjat=20lite=20med=20createPallet=20men?= =?UTF-8?q?=20ej=20klar.=20f=C3=B6ljt=20compendiet=20kanske=20ej=20r=C3=A4?= =?UTF-8?q?tt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/krusty/Database.java | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/main/java/krusty/Database.java b/src/main/java/krusty/Database.java index a9a7cac..ebf0683 100644 --- a/src/main/java/krusty/Database.java +++ b/src/main/java/krusty/Database.java @@ -81,8 +81,27 @@ public class Database { } public String createPallet(Request req, Response res) { - return "{}"; - } + + if (req.queryParams("cookie") != null) { + String cookie = req.queryParams("cookie"); + return createPallet(cookie); + } else { + return ""; + } + } + + protected String createPallet(String cookie) { + String query = ""; + try (PreparedStatement stmt = conn.prepareStatement(query)) { + + } catch (SQLException e) { + return ""; + } + return ""; + } + + + private String getJson(String query, String title) { //privat hjälpmetod så man slipper kalla på jsonizer varje gång try {