From 92a81135cd2ae8c4d86d99a839e850a226a2e8b1 Mon Sep 17 00:00:00 2001 From: Juanjo Date: Fri, 3 Feb 2023 12:28:00 +0100 Subject: [PATCH] Webjars y plantillas --- pom.xml | 61 +++++++++++++------ .../fp/edu/conecta2/modelo2/IbexEntity.java | 15 +++-- .../fp/edu/conecta2/modelo2/Tabla1Entity.java | 5 +- .../fp/edu/conecta2/modelo2/Tabla2Entity.java | 6 +- .../fp/edu/conecta2/modelo2/Tabla3Entity.java | 6 +- .../edu/conecta2/modelo2/VTabla1Entity.java | 8 +-- src/main/resources/application.properties | 4 +- src/main/resources/static/hola.html | 12 ++++ .../resources/templates/foot/javascript.html | 6 ++ src/main/resources/templates/head/head.html | 19 ++++++ src/main/resources/templates/inicio.html | 14 ++--- src/main/resources/templates/opcionales.html | 12 ++-- src/main/resources/templates/parametros.html | 13 ++-- src/main/resources/templates/usuarios.html | 14 ++--- 14 files changed, 128 insertions(+), 67 deletions(-) create mode 100644 src/main/resources/static/hola.html create mode 100644 src/main/resources/templates/foot/javascript.html create mode 100644 src/main/resources/templates/head/head.html diff --git a/pom.xml b/pom.xml index 5c2747d..39b0a73 100644 --- a/pom.xml +++ b/pom.xml @@ -17,58 +17,82 @@ 17 + org.springframework.boot - spring-boot-starter-data-jdbc + spring-boot-starter-web + org.springframework.boot - spring-boot-starter-data-jpa + spring-boot-devtools + runtime + true + org.springframework.boot - spring-boot-starter-thymeleaf + spring-boot-starter-data-jdbc org.springframework.boot - spring-boot-starter-web + spring-boot-starter-data-jpa - org.springframework.boot - spring-boot-devtools + org.mariadb.jdbc + mariadb-java-client runtime - true + + + org.springframework.session + spring-session-data-redis + 2.7.0 + + + com.h2database h2 runtime + - org.mariadb.jdbc - mariadb-java-client - runtime + org.springframework.boot + spring-boot-starter-thymeleaf - + - org.springframework.data - spring-data-mongodb - 4.0.1 + org.webjars + bootstrap + 5.2.2 - + - org.springframework.boot - spring-boot-starter-data-mongodb - 3.0.2 + org.webjars.bower + jquery + 3.6.1 + + org.webjars + font-awesome + 6.2.0 + + + + org.webjars + webjars-locator + 0.46 + org.springframework.boot spring-boot-starter-test test + @@ -76,6 +100,7 @@ org.springframework.boot spring-boot-maven-plugin + ${project.parent.version} diff --git a/src/main/java/es/fp/edu/conecta2/modelo2/IbexEntity.java b/src/main/java/es/fp/edu/conecta2/modelo2/IbexEntity.java index 5b9f55e..f198b56 100644 --- a/src/main/java/es/fp/edu/conecta2/modelo2/IbexEntity.java +++ b/src/main/java/es/fp/edu/conecta2/modelo2/IbexEntity.java @@ -7,6 +7,7 @@ import jakarta.persistence.Table; import java.math.BigDecimal; import java.sql.Date; +import java.util.Objects; @Entity @Table(name = "ibex", schema = "bolsa", catalog = "") @@ -97,14 +98,12 @@ public class IbexEntity { IbexEntity that = (IbexEntity) o; if (volume != that.volume) return false; - if (date != null ? !date.equals(that.date) : that.date != null) return false; - if (open != null ? !open.equals(that.open) : that.open != null) return false; - if (high != null ? !high.equals(that.high) : that.high != null) return false; - if (low != null ? !low.equals(that.low) : that.low != null) return false; - if (close != null ? !close.equals(that.close) : that.close != null) return false; - if (adjClose != null ? !adjClose.equals(that.adjClose) : that.adjClose != null) return false; - - return true; + if (!Objects.equals(date, that.date)) return false; + if (!Objects.equals(open, that.open)) return false; + if (!Objects.equals(high, that.high)) return false; + if (!Objects.equals(low, that.low)) return false; + if (!Objects.equals(close, that.close)) return false; + return Objects.equals(adjClose, that.adjClose); } @Override diff --git a/src/main/java/es/fp/edu/conecta2/modelo2/Tabla1Entity.java b/src/main/java/es/fp/edu/conecta2/modelo2/Tabla1Entity.java index e6b1c1a..67bf9c4 100644 --- a/src/main/java/es/fp/edu/conecta2/modelo2/Tabla1Entity.java +++ b/src/main/java/es/fp/edu/conecta2/modelo2/Tabla1Entity.java @@ -3,6 +3,7 @@ package es.fp.edu.conecta2.modelo2; import jakarta.persistence.*; import java.util.Collection; +import java.util.Objects; @Entity @Table(name = "tabla1", schema = "bolsa", catalog = "") @@ -41,9 +42,7 @@ public class Tabla1Entity { Tabla1Entity that = (Tabla1Entity) o; if (id != that.id) return false; - if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false; - - return true; + return Objects.equals(nombre, that.nombre); } @Override diff --git a/src/main/java/es/fp/edu/conecta2/modelo2/Tabla2Entity.java b/src/main/java/es/fp/edu/conecta2/modelo2/Tabla2Entity.java index e6edec5..4079409 100644 --- a/src/main/java/es/fp/edu/conecta2/modelo2/Tabla2Entity.java +++ b/src/main/java/es/fp/edu/conecta2/modelo2/Tabla2Entity.java @@ -2,6 +2,8 @@ package es.fp.edu.conecta2.modelo2; import jakarta.persistence.*; +import java.util.Objects; + @Entity @Table(name = "tabla2", schema = "bolsa", catalog = "") public class Tabla2Entity { @@ -52,9 +54,7 @@ public class Tabla2Entity { if (id != that.id) return false; if (tabla1Id != that.tabla1Id) return false; - if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false; - - return true; + return Objects.equals(nombre, that.nombre); } @Override diff --git a/src/main/java/es/fp/edu/conecta2/modelo2/Tabla3Entity.java b/src/main/java/es/fp/edu/conecta2/modelo2/Tabla3Entity.java index 72a765e..085ddc6 100644 --- a/src/main/java/es/fp/edu/conecta2/modelo2/Tabla3Entity.java +++ b/src/main/java/es/fp/edu/conecta2/modelo2/Tabla3Entity.java @@ -2,6 +2,8 @@ package es.fp.edu.conecta2.modelo2; import jakarta.persistence.*; +import java.util.Objects; + @Entity @Table(name = "tabla3", schema = "bolsa", catalog = "") public class Tabla3Entity { @@ -37,9 +39,7 @@ public class Tabla3Entity { Tabla3Entity that = (Tabla3Entity) o; if (id != that.id) return false; - if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false; - - return true; + return Objects.equals(nombre, that.nombre); } @Override diff --git a/src/main/java/es/fp/edu/conecta2/modelo2/VTabla1Entity.java b/src/main/java/es/fp/edu/conecta2/modelo2/VTabla1Entity.java index 2b7954f..090ada7 100644 --- a/src/main/java/es/fp/edu/conecta2/modelo2/VTabla1Entity.java +++ b/src/main/java/es/fp/edu/conecta2/modelo2/VTabla1Entity.java @@ -3,6 +3,8 @@ package es.fp.edu.conecta2.modelo2; import jakarta.persistence.*; import org.hibernate.annotations.Immutable; +import java.util.Objects; + @Entity @Immutable @Table(name = "v_tabla1", schema = "bolsa", catalog = "") @@ -50,10 +52,8 @@ public class VTabla1Entity { VTabla1Entity that = (VTabla1Entity) o; if (id != that.id) return false; - if (nombre != null ? !nombre.equals(that.nombre) : that.nombre != null) return false; - if (genero != null ? !genero.equals(that.genero) : that.genero != null) return false; - - return true; + if (!Objects.equals(nombre, that.nombre)) return false; + return Objects.equals(genero, that.genero); } @Override diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 3eec9ac..110e2bf 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,5 +1,6 @@ -server.port=9000 +server.port=9001 spring.thymeleaf.cache=false + server.compression.enabled=true server.http2.enabled=true @@ -20,7 +21,6 @@ persistente.jpa.properties.hibernate.dialect=org.hibernate.dialect.MariaDBDialec temporal.datasource.url=jdbc:h2:mem:test - temporal.datasource.username=sa temporal.datasource.password= temporal.jpa.show-sql=true diff --git a/src/main/resources/static/hola.html b/src/main/resources/static/hola.html new file mode 100644 index 0000000..72af718 --- /dev/null +++ b/src/main/resources/static/hola.html @@ -0,0 +1,12 @@ + + + + + Title + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/foot/javascript.html b/src/main/resources/templates/foot/javascript.html new file mode 100644 index 0000000..a8513ef --- /dev/null +++ b/src/main/resources/templates/foot/javascript.html @@ -0,0 +1,6 @@ +
+ Pie de página + + + +
diff --git a/src/main/resources/templates/head/head.html b/src/main/resources/templates/head/head.html new file mode 100644 index 0000000..00f4ea4 --- /dev/null +++ b/src/main/resources/templates/head/head.html @@ -0,0 +1,19 @@ + + + + + Título de la página + + + + + + + + + + Título de la página + + + + \ No newline at end of file diff --git a/src/main/resources/templates/inicio.html b/src/main/resources/templates/inicio.html index dde4132..95c18e9 100644 --- a/src/main/resources/templates/inicio.html +++ b/src/main/resources/templates/inicio.html @@ -1,11 +1,11 @@ - - - - - Title - + + + Hola mundo - + + \ No newline at end of file diff --git a/src/main/resources/templates/opcionales.html b/src/main/resources/templates/opcionales.html index c6a2bb3..31fe49f 100644 --- a/src/main/resources/templates/opcionales.html +++ b/src/main/resources/templates/opcionales.html @@ -1,13 +1,13 @@ - - - - - Title - + + + Parámetros opcionales:

aaaaa

bbbb

cccc

+ \ No newline at end of file diff --git a/src/main/resources/templates/parametros.html b/src/main/resources/templates/parametros.html index d9ebcf5..22a54e0 100644 --- a/src/main/resources/templates/parametros.html +++ b/src/main/resources/templates/parametros.html @@ -1,13 +1,14 @@ - - - - - - + + + Parámetros:

aaaaa

bbbb

cccc

+ + \ No newline at end of file diff --git a/src/main/resources/templates/usuarios.html b/src/main/resources/templates/usuarios.html index 587e29f..6498973 100644 --- a/src/main/resources/templates/usuarios.html +++ b/src/main/resources/templates/usuarios.html @@ -1,12 +1,12 @@ - - - - - Title - + + + + Listado de usuarios. - + \ No newline at end of file