From c95c094e138a783849277fc87280850212d72c51 Mon Sep 17 00:00:00 2001 From: Eneko Nieto Date: Mon, 4 Jan 2021 13:37:16 +0100 Subject: [PATCH] Entidades Travel y User. --- README.md | 4 ++-- .../eu/fosil/okupamicoche/entities/Travel.kt | 18 ++++++++++++++++++ .../eu/fosil/okupamicoche/entities/User.kt | 12 ++++++++++++ .../{ => spring}/OkupaMiCocheApplication.kt | 2 +- .../{ => spring}/ServletInitializer.kt | 2 +- 5 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 src/main/kotlin/eu/fosil/okupamicoche/entities/Travel.kt create mode 100644 src/main/kotlin/eu/fosil/okupamicoche/entities/User.kt rename src/main/kotlin/eu/fosil/okupamicoche/{ => spring}/OkupaMiCocheApplication.kt (87%) rename src/main/kotlin/eu/fosil/okupamicoche/{ => spring}/ServletInitializer.kt (90%) diff --git a/README.md b/README.md index 8061929..fd5e452 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# Okupa un coche - +# Okupa mi coche +Gestión de viajes en el valle. diff --git a/src/main/kotlin/eu/fosil/okupamicoche/entities/Travel.kt b/src/main/kotlin/eu/fosil/okupamicoche/entities/Travel.kt new file mode 100644 index 0000000..d2ae0ec --- /dev/null +++ b/src/main/kotlin/eu/fosil/okupamicoche/entities/Travel.kt @@ -0,0 +1,18 @@ +package eu.fosil.okupamicoche.entities + +import javax.persistence.Entity +import javax.persistence.GeneratedValue +import javax.persistence.Id + +@Entity +class Travel( + @Id @GeneratedValue var id: Long? = null, + var driver: User, + var travelers: List, + var departureDate: String, + var from: String, + var to: String, + var availablePlaces: Int, + var description: String? = null, + var matrixRoomId: String +) \ No newline at end of file diff --git a/src/main/kotlin/eu/fosil/okupamicoche/entities/User.kt b/src/main/kotlin/eu/fosil/okupamicoche/entities/User.kt new file mode 100644 index 0000000..e168424 --- /dev/null +++ b/src/main/kotlin/eu/fosil/okupamicoche/entities/User.kt @@ -0,0 +1,12 @@ +package eu.fosil.okupamicoche.entities + +import javax.persistence.Entity +import javax.persistence.GeneratedValue +import javax.persistence.Id + +@Entity +class User( + @Id @GeneratedValue var id: Long? = null, + var matrixId: String, + var name: String, + var email: String) \ No newline at end of file diff --git a/src/main/kotlin/eu/fosil/okupamicoche/OkupaMiCocheApplication.kt b/src/main/kotlin/eu/fosil/okupamicoche/spring/OkupaMiCocheApplication.kt similarity index 87% rename from src/main/kotlin/eu/fosil/okupamicoche/OkupaMiCocheApplication.kt rename to src/main/kotlin/eu/fosil/okupamicoche/spring/OkupaMiCocheApplication.kt index 4e1f258..db341ff 100644 --- a/src/main/kotlin/eu/fosil/okupamicoche/OkupaMiCocheApplication.kt +++ b/src/main/kotlin/eu/fosil/okupamicoche/spring/OkupaMiCocheApplication.kt @@ -1,4 +1,4 @@ -package eu.fosil.okupamicoche +package eu.fosil.okupamicoche.spring import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.runApplication diff --git a/src/main/kotlin/eu/fosil/okupamicoche/ServletInitializer.kt b/src/main/kotlin/eu/fosil/okupamicoche/spring/ServletInitializer.kt similarity index 90% rename from src/main/kotlin/eu/fosil/okupamicoche/ServletInitializer.kt rename to src/main/kotlin/eu/fosil/okupamicoche/spring/ServletInitializer.kt index 0c52915..2bec19a 100644 --- a/src/main/kotlin/eu/fosil/okupamicoche/ServletInitializer.kt +++ b/src/main/kotlin/eu/fosil/okupamicoche/spring/ServletInitializer.kt @@ -1,4 +1,4 @@ -package eu.fosil.okupamicoche +package eu.fosil.okupamicoche.spring import org.springframework.boot.builder.SpringApplicationBuilder import org.springframework.boot.web.servlet.support.SpringBootServletInitializer