Guest User

Untitled

a guest
Oct 19th, 2018
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. package jp.co.tarcoiz.security;
  2.  
  3. import java.util.ArrayList;
  4.  
  5. import org.springframework.security.core.GrantedAuthority;
  6. import org.springframework.security.core.userdetails.User;
  7.  
  8. import jp.co.tarcoiz.model.Person;
  9.  
  10. /**
  11. * ログイン認証ユーザEntity.
  12. */
  13. public class UserInfo extends User {
  14.  
  15.  
  16. private static final long serialVersionUID = 1L;
  17.  
  18. // 人物ID
  19. public Integer personId;
  20.  
  21. // ログインID
  22. public String username;
  23.  
  24. // パスワード
  25. public String password;
  26.  
  27. // ユーザ名
  28. public String personname;
  29.  
  30. // ロールID
  31. public Integer role;
  32.  
  33. public UserInfo(Person person) {
  34. super(person.getLoginId(), person.getPassword(), true, true, true, true, new ArrayList<GrantedAuthority>());
  35. personId = person.getPersonId();
  36. username = person.getLoginId();
  37. password = person.getPassword();
  38. personname = person.getName();
  39. role = person.getRoleId();
  40. }
  41.  
  42. public String getUsername() {
  43. return username;
  44. }
  45.  
  46. public void setUsername(String username) {
  47. this.username = username;
  48. }
  49.  
  50. public String getPassword() {
  51. return password;
  52. }
  53.  
  54. public void setPassword(String password) {
  55. this.password = password;
  56. }
  57.  
  58. public String getPersonname() {
  59. return personname;
  60. }
  61.  
  62. public void setPersonname(String personname) {
  63. this.personname = personname;
  64. }
  65.  
  66. public Integer getRole() {
  67. return role;
  68. }
  69.  
  70. public void setRole(Integer role) {
  71. this.role = role;
  72. }
  73.  
  74. public Integer getPersonId() {
  75. return personId;
  76. }
  77.  
  78. public void setPersonId(Integer personId) {
  79. this.personId = personId;
  80. }
  81.  
  82.  
  83. }
Add Comment
Please, Sign In to add comment