Token response
This commit is contained in:
34
restservice/src/main/java/com/plannaplan/responses/models/TokenResponse.java
Executable file
34
restservice/src/main/java/com/plannaplan/responses/models/TokenResponse.java
Executable file
@ -0,0 +1,34 @@
|
||||
package com.plannaplan.responses.models;
|
||||
|
||||
import com.plannaplan.entities.User;
|
||||
|
||||
public class TokenResponse {
|
||||
private String token;
|
||||
private Long id;
|
||||
private String authorityRole;
|
||||
private String email;
|
||||
|
||||
public TokenResponse(User user) {
|
||||
this.id = user.getId();
|
||||
this.authorityRole = user.getRole().toString();
|
||||
this.email = user.getEmail();
|
||||
this.token = user.getToken();
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public String getAuthorityRole() {
|
||||
return authorityRole;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user