This commit is contained in:
Your Name 2022-02-28 14:10:36 +01:00
parent 49694f4bc0
commit c8d9cd4db8
21 changed files with 764 additions and 29 deletions

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

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