LeoMoulin/Backend/Leo #55

Merged
tonitch merged 11 commits from LeoMoulin/Backend/Leo into master 2024-03-05 23:42:00 +01:00
6 changed files with 21 additions and 33 deletions
Showing only changes of commit bb0e6783ec - Show all commits

View File

View File

@ -8,7 +8,7 @@ public class Secretary {
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int id; private int id;
@JoinColumn(name = "User") @JoinColumn(name = "Users")
private int regNo; private int regNo;
private String faculty; private String faculty;

View File

@ -8,7 +8,7 @@ public class TeacherGivenCourse {
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int id; private int id;
@JoinColumn(name = "User") @JoinColumn(name = "Users")
private int regNo; private int regNo;
@JoinColumn(name = "Course") @JoinColumn(name = "Course")

View File

@ -1,21 +1,20 @@
package ovh.herisson.Clyde.Tables; package ovh.herisson.Clyde.Tables;
import jakarta.persistence.Entity; import jakarta.persistence.*;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
@Entity @Entity
public class Token { public class Token {
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
@Id @Id
private int id; private int id;
private int regNo;
private String data;
public Token(int regNo, String data){ @JoinColumn(name ="Users")
private int regNo;
private String token;
Review

data ? peut-être être plus précis dans le nom ?

data ? peut-être être plus précis dans le nom ?
Review

Je vais juste le rename en token comme ca c'est plié !

Je vais juste le rename en token comme ca c'est plié !
public Token(int regNo, String token){
this.regNo = regNo; this.regNo = regNo;
this.data = data; this.token = token;
} }
public Token(){} public Token(){}
@ -31,11 +30,11 @@ public class Token {
this.regNo = regNo; this.regNo = regNo;
} }
public String getData(){ public String getToken(){
return data; return token;
} }
public void setData(String data) { public void setToken(String data) {
this.data = data; this.token = data;
} }
} }

View File

@ -17,22 +17,20 @@ public class User {
private String lastName; private String lastName;
private String firstName; private String firstName;
private String email; private String email;
private String adress; private String address;
private String country; private String country;
private Date birthDate; private Date birthDate;
private ovh.herisson.Clyde.Tables.Role role; private ovh.herisson.Clyde.Tables.Role role;
private String password; private String password;
private String salt; public User(String lastName, String firstName, String email, String address, String country, Date birthDate, Role role, String password){
public User(String lastName, String firstName, String email, String adress, String country, Date birthDate, Role role, String password, String salt){
this.lastName = lastName; this.lastName = lastName;
this.firstName = firstName; this.firstName = firstName;
this.email = email; this.email = email;
this.adress = adress; this.address = address;
this.country = country; this.country = country;
this.birthDate = birthDate; this.birthDate = birthDate;
this.role = role; this.role = role;
this.password = password; this.password = password;
this.salt = salt;
} }
public User() {} public User() {}
@ -64,12 +62,12 @@ public class User {
this.email = email; this.email = email;
} }
public String getAdress() { public String getAddress() {
return adress; return address;
} }
public void setAdress(String adress) { public void setAddress(String adress) {
this.adress = adress; this.address = adress;
} }
public String getCountry() { public String getCountry() {
@ -102,12 +100,4 @@ public class User {
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
public String getSalt(){
return salt;
}
public void setSalt(String salt) {
this.salt = salt;
}
} }

View File

@ -3,12 +3,11 @@ package ovh.herisson.Clyde.Tables;
import jakarta.persistence.*; import jakarta.persistence.*;
@Entity @Entity
@Table(name = "User_Cursus")
public class UserCursus { public class UserCursus {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private int id; private int id;
@JoinColumn(name = "User") @JoinColumn(name = "Users")
private int regNo; private int regNo;
@JoinColumn(name = "Cursus") @JoinColumn(name = "Cursus")