diff --git a/backend/build.gradle.kts b/backend/build.gradle.kts index 91c7679..85fae7b 100644 --- a/backend/build.gradle.kts +++ b/backend/build.gradle.kts @@ -19,6 +19,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-jdbc") implementation("org.springframework.boot:spring-boot-starter-mail") implementation("org.springframework.boot:spring-boot-starter-web") + implementation("org.springframework.boot:spring-boot-starter-data-jpa") // implementation("org.springframework.session:spring-session-jdbc") developmentOnly("org.springframework.boot:spring-boot-devtools") developmentOnly("org.springframework.boot:spring-boot-docker-compose") diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java new file mode 100644 index 0000000..b5bdf00 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Course.java @@ -0,0 +1,16 @@ +package ovh.herisson.Clyde.Tables; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Course { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int CourseID; + private int Credits; + private String Title; + private String Faculty; +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java new file mode 100644 index 0000000..c909f9e --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Cursus.java @@ -0,0 +1,16 @@ +package ovh.herisson.Clyde.Tables; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Cursus { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int CursusId; + private int Year; + private String Option; + +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusCourse.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusCourse.java new file mode 100644 index 0000000..c8a669f --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/CursusCourse.java @@ -0,0 +1,16 @@ +package ovh.herisson.Clyde.Tables; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class CursusCourse { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int id; + private int CursusId; + private int CourseId; + +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Role.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Role.java new file mode 100644 index 0000000..d9ccb94 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Role.java @@ -0,0 +1,7 @@ +package ovh.herisson.Clyde.Tables; + +public enum Role { + Teacher, + Student; + +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/Secretary.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/Secretary.java new file mode 100644 index 0000000..8c2220b --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/Secretary.java @@ -0,0 +1,15 @@ +package ovh.herisson.Clyde.Tables; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class Secretary { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int id; + private int RegNo; + private String Faculty; +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherGivenCourse.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherGivenCourse.java new file mode 100644 index 0000000..cf6e39d --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherGivenCourse.java @@ -0,0 +1,15 @@ +package ovh.herisson.Clyde.Tables; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class TeacherGivenCourse { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int id; + private int RegNo; + private int CourseId; +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherOwnerCourse.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherOwnerCourse.java new file mode 100644 index 0000000..385f504 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/TeacherOwnerCourse.java @@ -0,0 +1,16 @@ +package ovh.herisson.Clyde.Tables; + +import jakarta.persistence.Entity; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; + +@Entity +public class TeacherOwnerCourse { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int id; + + private int RegNo; + private int CourseId; +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java new file mode 100644 index 0000000..ca69efe --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/User.java @@ -0,0 +1,35 @@ +package ovh.herisson.Clyde.Tables; + +import jakarta.persistence.*; + +import java.util.Date; + +//Classe représentant un utilisateur l'attribut password demande surement un peu de rafinement niveau sécurité +//et l'attribut tokenApi doit encore être ajouté vu qu'il faut en discuter + +@Entity +//Je rajoute un s au nom de la table pour éviter les conflits avec les mots réservés +@Table(name = "Users") +public class User { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int RegNo; + + private String LastName; + private String FirstName; + private String Email; + private String Adress; + private String Country; + private Date BirthDate; + private ovh.herisson.Clyde.Tables.Role Role; + private String Password; + + public User(String LastName, String FirstName){ + this.LastName = LastName; + this.FirstName = FirstName; + } + + public User() { + + } +} diff --git a/backend/src/main/java/ovh/herisson/Clyde/Tables/UserCursus.java b/backend/src/main/java/ovh/herisson/Clyde/Tables/UserCursus.java new file mode 100644 index 0000000..d638198 --- /dev/null +++ b/backend/src/main/java/ovh/herisson/Clyde/Tables/UserCursus.java @@ -0,0 +1,13 @@ +package ovh.herisson.Clyde.Tables; + +import jakarta.persistence.*; + +@Entity +@Table(name = "User_Cursus") +public class UserCursus { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private int id; + private int RegNo; + private int CursusId; +}