LeoMoulin/Backend/Leo #55

Merged
tonitch merged 11 commits from LeoMoulin/Backend/Leo into master 2024-03-05 23:42:00 +01:00
10 changed files with 150 additions and 0 deletions
Showing only changes of commit 69c3a3b965 - Show all commits

View File

@ -19,6 +19,7 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-jdbc") implementation("org.springframework.boot:spring-boot-starter-jdbc")
implementation("org.springframework.boot:spring-boot-starter-mail") implementation("org.springframework.boot:spring-boot-starter-mail")
implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
// implementation("org.springframework.session:spring-session-jdbc") // implementation("org.springframework.session:spring-session-jdbc")
developmentOnly("org.springframework.boot:spring-boot-devtools") developmentOnly("org.springframework.boot:spring-boot-devtools")
developmentOnly("org.springframework.boot:spring-boot-docker-compose") developmentOnly("org.springframework.boot:spring-boot-docker-compose")

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -0,0 +1,7 @@
package ovh.herisson.Clyde.Tables;
public enum Role {
Teacher,
Student;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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() {
}
}

Pas Salt !

Pas Salt !

View File

@ -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;
}