From 4df68aef79ec938544ac0af37f0aadfd468c889e Mon Sep 17 00:00:00 2001 From: Cristobal Bernal Mayordomo <90463533+Racriberny@users.noreply.github.com> Date: Wed, 8 Feb 2023 16:42:35 +0100 Subject: [PATCH] nos consigo el puto login --- .../cristobalbernal/foro/Entidades/Foro.java | 115 ++++++++++++++++++ .../templates/Registrar/Registrar.html | 43 +++++++ 2 files changed, 158 insertions(+) create mode 100644 src/main/java/com/cristobalbernal/foro/Entidades/Foro.java create mode 100644 src/main/resources/templates/Registrar/Registrar.html diff --git a/src/main/java/com/cristobalbernal/foro/Entidades/Foro.java b/src/main/java/com/cristobalbernal/foro/Entidades/Foro.java new file mode 100644 index 0000000..be05ef0 --- /dev/null +++ b/src/main/java/com/cristobalbernal/foro/Entidades/Foro.java @@ -0,0 +1,115 @@ +package com.cristobalbernal.foro.Entidades; + +import jakarta.persistence.*; + +import java.sql.Timestamp; + +@Entity +public class Foro { + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Id + @Column(name = "id", nullable = false) + private int id; + @Basic + @Column(name = "titulo", nullable = true, length = 150) + private String titulo; + @Basic + @Column(name = "descripcion", nullable = true, length = 150) + private String descripcion; + @Basic + @Column(name = "fechaYHora", nullable = true) + private Timestamp fechaYHora; + @Basic + @Column(name = "imagen", nullable = false) + private int imagen; + @Basic + @Column(name = "categoria_foro_id", nullable = false) + private int categoriaForoId; + + public Foro() { + } + + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + + public String getTitulo() { + return titulo; + } + + public void setTitulo(String titulo) { + this.titulo = titulo; + } + + public String getDescripcion() { + return descripcion; + } + + public void setDescripcion(String descripcion) { + this.descripcion = descripcion; + } + + public Timestamp getFechaYHora() { + return fechaYHora; + } + + public void setFechaYHora(Timestamp fechaYHora) { + this.fechaYHora = fechaYHora; + } + + public int getImagen() { + return imagen; + } + + public void setImagen(int imagen) { + this.imagen = imagen; + } + + public int getCategoriaForoId() { + return categoriaForoId; + } + + public void setCategoriaForoId(int categoriaForoId) { + this.categoriaForoId = categoriaForoId; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + Foro foro = (Foro) o; + + if (id != foro.id) return false; + if (imagen != foro.imagen) return false; + if (categoriaForoId != foro.categoriaForoId) return false; + if (titulo != null ? !titulo.equals(foro.titulo) : foro.titulo != null) return false; + if (descripcion != null ? !descripcion.equals(foro.descripcion) : foro.descripcion != null) return false; + if (fechaYHora != null ? !fechaYHora.equals(foro.fechaYHora) : foro.fechaYHora != null) return false; + + return true; + } + + @Override + public int hashCode() { + int result = id; + result = 31 * result + (titulo != null ? titulo.hashCode() : 0); + result = 31 * result + (descripcion != null ? descripcion.hashCode() : 0); + result = 31 * result + (fechaYHora != null ? fechaYHora.hashCode() : 0); + result = 31 * result + imagen; + result = 31 * result + categoriaForoId; + return result; + } + + public Foro(int id, String titulo, String descripcion, int imagen, int categoriaForoId) { + this.id = id; + this.titulo = titulo; + this.descripcion = descripcion; + this.imagen = imagen; + this.categoriaForoId = categoriaForoId; + } +} diff --git a/src/main/resources/templates/Registrar/Registrar.html b/src/main/resources/templates/Registrar/Registrar.html new file mode 100644 index 0000000..b62b399 --- /dev/null +++ b/src/main/resources/templates/Registrar/Registrar.html @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + +
+ + + + + + +