secu
This commit is contained in:
parent
49694f4bc0
commit
c8d9cd4db8
21 changed files with 764 additions and 29 deletions
21
src/main/java/fr/cardon/simpleat/dto/JsonWebToken.java
Normal file
21
src/main/java/fr/cardon/simpleat/dto/JsonWebToken.java
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package fr.cardon.simpleat.dto;
|
||||
|
||||
/**
|
||||
* Classe spécifique DTO (Data Transfer Object) qui retourne un Jeton au format JSON (REST response)
|
||||
*
|
||||
*/
|
||||
|
||||
public class JsonWebToken {
|
||||
|
||||
private final String token;
|
||||
|
||||
public JsonWebToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
55
src/main/java/fr/cardon/simpleat/dto/PersonneDto.java
Normal file
55
src/main/java/fr/cardon/simpleat/dto/PersonneDto.java
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
package fr.cardon.simpleat.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import com.sun.istack.NotNull;
|
||||
|
||||
import fr.cardon.simpleat.model.Role;
|
||||
|
||||
/**
|
||||
* Specifique : AppUser DTO permet de renvoyer un User sans le mot de passe (REST response).
|
||||
*/
|
||||
public class PersonneDto {
|
||||
|
||||
private Long id;
|
||||
private String email;
|
||||
private List<Role> roleList;
|
||||
|
||||
public PersonneDto() { }
|
||||
|
||||
public PersonneDto(@NotNull String email) {
|
||||
this(email,null);
|
||||
}
|
||||
|
||||
public PersonneDto(@NotNull String email, List<Role> roleList) {
|
||||
this.email = email;
|
||||
this.roleList = roleList;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public List<Role> getRoleList() {
|
||||
return roleList;
|
||||
}
|
||||
|
||||
public void setRoleList(List<Role> roleList) {
|
||||
this.roleList = roleList;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue