From 285050f3eaea035ccaa7ffe977d79b58877846c2 Mon Sep 17 00:00:00 2001 From: Roberto Date: Sun, 5 May 2024 16:24:29 -0600 Subject: [PATCH] estructura backend --- healthmanager_back/pom.xml | 97 ++++++++++++++++++ .../src/main/java/mx/uv/App.java | 37 +++++++ .../src/main/java/mx/uv/Conexion.java | 5 + .../src/main/java/mx/uv/DAO.java | 5 + .../src/main/java/mx/uv/Usuario.java | 5 + .../src/test/java/mx/uv/AppTest.java | 20 ++++ .../target/classes/mx/uv/App.class | Bin 0 -> 561 bytes .../target/classes/mx/uv/Conexion.class | Bin 0 -> 261 bytes .../target/classes/mx/uv/DAO.class | Bin 0 -> 246 bytes .../target/classes/mx/uv/Usuario.class | Bin 0 -> 258 bytes .../target/test-classes/mx/uv/AppTest.class | Bin 0 -> 457 bytes 11 files changed, 169 insertions(+) create mode 100644 healthmanager_back/pom.xml create mode 100644 healthmanager_back/src/main/java/mx/uv/App.java create mode 100644 healthmanager_back/src/main/java/mx/uv/Conexion.java create mode 100644 healthmanager_back/src/main/java/mx/uv/DAO.java create mode 100644 healthmanager_back/src/main/java/mx/uv/Usuario.java create mode 100644 healthmanager_back/src/test/java/mx/uv/AppTest.java create mode 100644 healthmanager_back/target/classes/mx/uv/App.class create mode 100644 healthmanager_back/target/classes/mx/uv/Conexion.class create mode 100644 healthmanager_back/target/classes/mx/uv/DAO.class create mode 100644 healthmanager_back/target/classes/mx/uv/Usuario.class create mode 100644 healthmanager_back/target/test-classes/mx/uv/AppTest.class diff --git a/healthmanager_back/pom.xml b/healthmanager_back/pom.xml new file mode 100644 index 0000000..a57ccbe --- /dev/null +++ b/healthmanager_back/pom.xml @@ -0,0 +1,97 @@ + + + + 4.0.0 + + mx.uv + healthmanager_back + 1.0-SNAPSHOT + + healthmanager_back + + http://www.example.com + + + UTF-8 + 1.7 + 1.7 + + + + + junit + junit + 4.11 + test + + + com.sparkjava + spark-core + 2.9.4 + + + org.slf4j + slf4j-simple + 1.7.21 + + + + com.google.code.gson + gson + 2.8.6 + + + + mysql + mysql-connector-java + 8.0.30 + + + + + + + + + maven-clean-plugin + 3.1.0 + + + + maven-resources-plugin + 3.0.2 + + + maven-compiler-plugin + 3.8.0 + + + 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 + + + + + diff --git a/healthmanager_back/src/main/java/mx/uv/App.java b/healthmanager_back/src/main/java/mx/uv/App.java new file mode 100644 index 0000000..ff65019 --- /dev/null +++ b/healthmanager_back/src/main/java/mx/uv/App.java @@ -0,0 +1,37 @@ +package mx.uv; + +import com.google.gson.JsonObject; +import static spark.Spark.*; +import java.util.HashMap; +import com.google.gson.Gson; + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "HEALTH MANAGER BACK END CORRIENDO..." ); + + //CORS + options("/*", (request, response) -> { + + String accessControlRequestHeaders = request.headers("Access-Control-Request-Headers"); + if (accessControlRequestHeaders != null) { + response.header("Access-Control-Allow-Headers", accessControlRequestHeaders); + } + + String accessControlRequestMethod = request.headers("Access-Control-Request-Method"); + if (accessControlRequestMethod != null) { + response.header("Access-Control-Allow-Methods", accessControlRequestMethod); + } + + return "OK"; + }); + + before((request, response) -> response.header("Access-Control-Allow-Origin", "*")); + //CORS + } +} diff --git a/healthmanager_back/src/main/java/mx/uv/Conexion.java b/healthmanager_back/src/main/java/mx/uv/Conexion.java new file mode 100644 index 0000000..f2671db --- /dev/null +++ b/healthmanager_back/src/main/java/mx/uv/Conexion.java @@ -0,0 +1,5 @@ +package mx.uv; + +public class Conexion { + +} diff --git a/healthmanager_back/src/main/java/mx/uv/DAO.java b/healthmanager_back/src/main/java/mx/uv/DAO.java new file mode 100644 index 0000000..18bbb07 --- /dev/null +++ b/healthmanager_back/src/main/java/mx/uv/DAO.java @@ -0,0 +1,5 @@ +package mx.uv; + +public class DAO { + +} diff --git a/healthmanager_back/src/main/java/mx/uv/Usuario.java b/healthmanager_back/src/main/java/mx/uv/Usuario.java new file mode 100644 index 0000000..c12c962 --- /dev/null +++ b/healthmanager_back/src/main/java/mx/uv/Usuario.java @@ -0,0 +1,5 @@ +package mx.uv; + +public class Usuario { + +} diff --git a/healthmanager_back/src/test/java/mx/uv/AppTest.java b/healthmanager_back/src/test/java/mx/uv/AppTest.java new file mode 100644 index 0000000..6284b29 --- /dev/null +++ b/healthmanager_back/src/test/java/mx/uv/AppTest.java @@ -0,0 +1,20 @@ +package mx.uv; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +/** + * Unit test for simple App. + */ +public class AppTest +{ + /** + * Rigorous Test :-) + */ + @Test + public void shouldAnswerWithTrue() + { + assertTrue( true ); + } +} diff --git a/healthmanager_back/target/classes/mx/uv/App.class b/healthmanager_back/target/classes/mx/uv/App.class new file mode 100644 index 0000000000000000000000000000000000000000..6c7308e024d2c8b142b2d8748beb4ac3aa4faaca GIT binary patch literal 561 zcmb_ZJx{|h5Pj|kY10Cwd~arJ8Hf-Iq6i5gm?9W}N{Gp6tzzWFk&}k*n6e?oa=-m7B#@DG;(Wuw$J6Iw4IdN{Su{EqRyxc}sCPrs+$Ok5jl@_To5s$5* zj$v}d-MTNrU?{kp#FUy4n{Z(z7h0PqDl?IO<|5^Z8QX#6T4qx7{k=nOEEj>v?J3qi36(HcSS=Jv6lK^fxUC=4z=R3_ literal 0 HcmV?d00001 diff --git a/healthmanager_back/target/classes/mx/uv/Conexion.class b/healthmanager_back/target/classes/mx/uv/Conexion.class new file mode 100644 index 0000000000000000000000000000000000000000..0008b41921933a0e087e9d8bed4c82c86fb8c7f0 GIT binary patch literal 261 zcmY*UF>b;@5S%qOCJqi3KcFKiaz)BSG)Pny6d?C!bAm(mo#faS-%5p)A`i%;Q1+}) z(9G=YYBaOI*Y6(yZ%9ITgs18(+DuHZCe*= zrJXmv)p>PIFazguXE2k?V+>h|UIW3)1*0!sc!(I?8EklD9QSj;9JAtg89hw?0PN2* A{Qv*} literal 0 HcmV?d00001 diff --git a/healthmanager_back/target/classes/mx/uv/DAO.class b/healthmanager_back/target/classes/mx/uv/DAO.class new file mode 100644 index 0000000000000000000000000000000000000000..555a5d1fc32ad371a7969f20316fb3ca62446db9 GIT binary patch literal 246 zcmX|5%MQU%6r5A7QqTAUJ1pFVC6NfRYFH5a+q&UOwMn(&x2z-=4qKnREU0Uc1V1to|Ei3&l%(Qm>EHp(G|1o15@BnlqDqYz$1Lo@c+ z9?!hqk0*dJIxZ|iGr5ZLB6jCe<~nm>6FQN+ND<5QDAqxw!h%qp>QomqLZv_06YP0* zP#!9%`*2Vtw3j+nt1<~xzLi0&2;F5C%6QLD4gU@8;-t^!`peWcg1`t^S&5nlA+!+Basb6t~}rT4Bb>&@BZ^> zm!WB=rpU&rwl6Y&Qf}JM3kqpH6xyk|94M