1+ package com .yy .example .bean ;
2+
3+ import com .fasterxml .jackson .annotation .JsonIgnore ;
4+ import org .springframework .security .core .GrantedAuthority ;
5+ import org .springframework .security .core .userdetails .UserDetails ;
6+
7+ import java .util .Collection ;
8+ import java .util .List ;
9+
10+ public class User implements UserDetails {
11+ private Integer id ;
12+ private String cnname ;
13+ private String username ;
14+ @ JsonIgnore
15+ private String password ;
16+ private String rePassword ;
17+ private String historyPassword ;
18+ private String email ;
19+ @ JsonIgnore
20+ private String telephone ;
21+ private String mobilePhone ;
22+ private List <? extends GrantedAuthority > authorities ;
23+ private Role role ;
24+ private Integer roleId ;
25+
26+
27+ @ Override
28+ @ JsonIgnore
29+ public boolean isAccountNonExpired () {
30+ return true ;
31+ }
32+
33+ @ Override
34+ @ JsonIgnore
35+ public boolean isAccountNonLocked () {
36+ return true ;
37+ }
38+
39+ @ Override
40+ @ JsonIgnore
41+ public boolean isCredentialsNonExpired () {
42+ return true ;
43+ }
44+
45+ @ Override
46+ @ JsonIgnore
47+ public boolean isEnabled () {
48+ return true ;
49+ }
50+
51+ public void setUsername (String username ) {
52+ this .username = username ;
53+ }
54+
55+ @ JsonIgnore
56+ public Collection <? extends GrantedAuthority > getAuthorities () {
57+ return authorities ;
58+ }
59+
60+ public void setGrantedAuthorities (List <? extends GrantedAuthority > authorities ) {
61+ this .authorities = authorities ;
62+ }
63+
64+ public Integer getId () {
65+ return id ;
66+ }
67+
68+ public void setId (Integer id ) {
69+ this .id = id ;
70+ }
71+
72+ public String getCnname () {
73+ return cnname ;
74+ }
75+
76+ public void setCnname (String cnname ) {
77+ this .cnname = cnname ;
78+ }
79+
80+ public String getUsername () {
81+ return username ;
82+ }
83+
84+ public String getPassword () {
85+ return password ;
86+ }
87+
88+ public void setPassword (String password ) {
89+ this .password = password ;
90+ }
91+
92+ public String getEmail () {
93+ return email ;
94+ }
95+
96+ public void setEmail (String email ) {
97+ this .email = email ;
98+ }
99+
100+ public String getTelephone () {
101+ return telephone ;
102+ }
103+
104+ public void setTelephone (String telephone ) {
105+ this .telephone = telephone ;
106+ }
107+
108+ public String getMobilePhone () {
109+ return mobilePhone ;
110+ }
111+
112+ public void setMobilePhone (String mobilePhone ) {
113+ this .mobilePhone = mobilePhone ;
114+ }
115+
116+ public String getRePassword () {
117+ return rePassword ;
118+ }
119+
120+ public void setRePassword (String rePassword ) {
121+ this .rePassword = rePassword ;
122+ }
123+
124+ public String getHistoryPassword () {
125+ return historyPassword ;
126+ }
127+
128+ public void setHistoryPassword (String historyPassword ) {
129+ this .historyPassword = historyPassword ;
130+ }
131+
132+ public Role getRole () {
133+ return role ;
134+ }
135+
136+ public void setRole (Role role ) {
137+ this .role = role ;
138+ }
139+
140+ public Integer getRoleId () {
141+ return roleId ;
142+ }
143+
144+ public void setRoleId (Integer roleId ) {
145+ this .roleId = roleId ;
146+ }
147+ @ Override
148+ public String toString () {
149+ return "User{" +
150+ "id=" + id +
151+ ", cnname=" + cnname +
152+ ", username=" + username +
153+ ", password=" + password +
154+ ", email=" + email +
155+ ", telephone=" + telephone +
156+ ", mobilePhone=" + mobilePhone +
157+ '}' ;
158+ }
159+ }
0 commit comments