From 613e08c53fde50f8185f199cba4192aaef0bb2cd Mon Sep 17 00:00:00 2001 From: Soka_jplr Date: Thu, 18 Apr 2024 09:44:13 -0600 Subject: [PATCH] backend configurado --- backend/pom.xml | 99 ++++++++++++++++------------ backend/src/main/java/mx/uv/App.java | 23 +++++-- 2 files changed, 76 insertions(+), 46 deletions(-) diff --git a/backend/pom.xml b/backend/pom.xml index 745a3a5..7390a10 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -14,8 +14,8 @@ UTF-8 - 1.7 - 1.7 + 1.8 + 1.8 @@ -25,51 +25,66 @@ 4.11 test + + + com.sparkjava + spark-core + 2.9.4 + + + + org.slf4j + slf4j-simple + 1.7.21 + + + + com.google.code.gson + gson + 2.10.1 + compile + + + + mysql + mysql-connector-java + 8.0.30 + - - - + - maven-clean-plugin - 3.1.0 - - - - maven-resources-plugin - 3.0.2 + org.apache.maven.plugins + maven-compiler-plugin + 2.3.2 + + 1.8 + 1.8 + - maven-compiler-plugin - 3.8.0 + maven-assembly-plugin + + + package + + single + + + + + + + jar-with-dependencies + + + + mx.uv.App + + + - - maven-surefire-plugin - 2.22.1 - - - maven-jar-plugin - 3.0.2 - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - - maven-site-plugin - 3.7.1 - - - maven-project-info-reports-plugin - 3.0.0 - - - + - + \ No newline at end of file diff --git a/backend/src/main/java/mx/uv/App.java b/backend/src/main/java/mx/uv/App.java index a2d3cff..807da20 100644 --- a/backend/src/main/java/mx/uv/App.java +++ b/backend/src/main/java/mx/uv/App.java @@ -1,13 +1,28 @@ package mx.uv; +import static spark.Spark.*; -/** - * Hello world! - * - */ +import java.util.HashMap; +import java.util.UUID; + +import com.google.gson.*; public class App { public static void main( String[] args ) { System.out.println( "Hello World!" ); + //port(80); + + get("/usuarios", (request, response) ->{ + response.type("application/json"); + JsonObject respuesta = new JsonObject(); + respuesta.addProperty("msj", ""); + return respuesta; + }); + post("/usuarios", (request, response) ->{ + String payload = request.body(); + JsonObject respuesta = new JsonObject(); + respuesta.addProperty("msj", ""); + return respuesta; + }); } }