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
| package com.mindskip.xzs.configuration.spring.security;
|
| import lombok.Getter;
| import lombok.Setter;
| import org.springframework.security.core.GrantedAuthority;
| import org.springframework.security.core.userdetails.User;
|
| import java.util.Collection;
| import java.util.List;
|
| /**
| * @author gonghl
| * @since 2024/5/16 上午 10:35
| */
|
| @Getter
| @Setter
| public class MyUser extends User {
|
| private Integer role;
| private List<Integer> deptId;
|
|
| public MyUser(String username, String password, Collection<? extends GrantedAuthority> authorities, Integer role, List<Integer> deptId) {
| super(username, password, authorities);
| this.role = role;
| this.deptId = deptId;
| }
|
| public MyUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities, Integer role, List<Integer> deptId) {
| super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
| this.role = role;
| this.deptId = deptId;
| }
| }
|
|