You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

59 line
1.3 KiB

  1. package com.ffii.fpsms.model;
  2. import java.io.Serializable;
  3. import java.util.List;
  4. import java.util.Set;
  5. import com.ffii.fpsms.modules.user.entity.User;
  6. public class JwtResponse implements Serializable {
  7. private static final long serialVersionUID = -8091879091924046844L;
  8. private final Long id;
  9. private final String name;
  10. private final String email;
  11. private final String accessToken;
  12. private final String refreshToken;
  13. private final String role;
  14. private final List<String> abilities;
  15. // private final Set<AbilityModel> abilities;
  16. public JwtResponse(String accessToken, String refreshToken, String role, User user, List<String> abilities) {
  17. // public JwtResponse(String accessToken, String refreshToken, String role, User user, Set<AbilityModel> abilities) {
  18. this.accessToken = accessToken;
  19. this.refreshToken = refreshToken;
  20. this.role = role;
  21. this.id = user.getId();
  22. this.name = user.getName();
  23. this.email = user.getEmail();
  24. this.abilities = abilities;
  25. }
  26. public String getAccessToken() {
  27. return this.accessToken;
  28. }
  29. public String getRole() {
  30. return role;
  31. }
  32. public String getRefreshToken() {
  33. return refreshToken;
  34. }
  35. public Long getId() {
  36. return id;
  37. }
  38. public String getName() {
  39. return name;
  40. }
  41. public String getEmail() {
  42. return email;
  43. }
  44. public List<String> getAbilities() {
  45. return abilities;
  46. }
  47. }