43 lines
1.1 KiB
Java
Executable File
43 lines
1.1 KiB
Java
Executable File
package com.plannaplan.responses.models;
|
|
|
|
import com.plannaplan.entities.User;
|
|
|
|
import io.swagger.annotations.ApiModel;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
|
@ApiModel(description = "Response shows information about logged user.", value = "TokenResponse")
|
|
public class TokenResponse {
|
|
@ApiModelProperty(value = "user token used to verify requests")
|
|
private String token;
|
|
@ApiModelProperty(value = "user id in database")
|
|
private Long id;
|
|
@ApiModelProperty(value = "user app role")
|
|
private String authorityRole;
|
|
@ApiModelProperty(value = "user unviersity email")
|
|
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;
|
|
}
|
|
|
|
}
|