郑永安
2023-09-19 69185134fcfaf913ea45f1255677225a2cc311a4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
package com.gk.hotwork.Config.Oauth2;
 
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
 
import java.util.Collection;
import java.util.List;
 
/**
 * oauth2.0授权 用户类
 *
 * @author zhangby
 * @date 2019-05-13 16:22
 */
@ApiModel(value = "OauthUser")
public class OauthUser implements UserDetails {
 
    /**
     * 用户id
     */
    @ApiModelProperty(hidden = true)
    private String id;
    /**
     * 用户名
     */
    @ApiModelProperty(value = "username(登录名)", example = "admin")
    private String username;
    /**
     * 密码
     */
    @ApiModelProperty(value = "password(密码)", example = "123")
    private String password;
 
 
    private String company;
 
    private Integer userType;
 
    private Long department;
 
    private String departmentName;
 
    private String idcard;
    /**
     * 用户角色
     */
    @ApiModelProperty(hidden = true)
    private List<OauthRole> oauthRoles = Lists.newArrayList();
 
    @Override
    @ApiModelProperty(hidden = true)
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return this.oauthRoles;
    }
 
    @Override
    @ApiModelProperty(hidden = true)
    public String getPassword() {
        return this.password;
    }
 
    @Override
    @ApiModelProperty(hidden = true)
    public String getUsername() {
        return this.username;
    }
 
    @Override
    @ApiModelProperty(hidden = true)
    public boolean isAccountNonExpired() {
        return true;
    }
 
    @Override
    @ApiModelProperty(hidden = true)
    public boolean isAccountNonLocked() {
        return true;
    }
 
    @Override
    @ApiModelProperty(hidden = true)
    public boolean isCredentialsNonExpired() {
        return true;
    }
 
    @Override
    @ApiModelProperty(hidden = true)
    public boolean isEnabled() {
        return true;
    }
 
    public String getId() {
        return id;
    }
 
    public void setId(String id) {
        this.id = id;
    }
 
    public void setUsername(String username) {
        this.username = username;
    }
 
    public void setPassword(String password) {
        this.password = password;
    }
 
    public List<OauthRole> getOauthRoles() {
        return oauthRoles;
    }
 
    public void setOauthRoles(List<OauthRole> oauthRoles) {
        this.oauthRoles = oauthRoles;
    }
 
    public String getCompany() {
        return company;
    }
 
    public void setCompany(String company) {
        this.company = company;
    }
 
    public Integer getUserType() {
        return userType;
    }
 
    public void setUserType(Integer userType) {
        this.userType = userType;
    }
 
    public Long getDepartment() {
        return department;
    }
 
    public void setDepartment(Long department) {
        this.department = department;
    }
 
    public String getDepartmentName() {
        return departmentName;
    }
 
    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }
 
    public String getIdcard() {
        return idcard;
    }
 
    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
}