Helius
2020-05-13 d0de0bf06f69c8584330e857ec1ecce34b244c9f
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
package com.xcong.excoin.common.system.bean;
 
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.xcong.excoin.modules.member.entity.MemberEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
 
import java.util.List;
 
/**
 * @author wzy
 * @date 2020-05-12
 **/
@Getter
@AllArgsConstructor
public class LoginUserBean implements UserDetails {
 
    private final MemberEntity memberEntity;
 
    private final List<Long> roles;
 
    private final List<GrantedAuthority> authorities;
 
    @JsonIgnore
    @Override
    public String getPassword() {
        return memberEntity.getPassword();
    }
 
    @JsonIgnore
    @Override
    public String getUsername() {
        return memberEntity.getUsername();
    }
 
    @JsonIgnore
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }
 
    @JsonIgnore
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }
 
    @JsonIgnore
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }
 
    @JsonIgnore
    @Override
    public boolean isEnabled() {
        return true;
    }
}