1 package cn.home1.oss.lib.security.api;
2
3 import static lombok.AccessLevel.PROTECTED;
4
5 import io.swagger.annotations.ApiModel;
6 import io.swagger.annotations.ApiModelProperty;
7
8 import lombok.AllArgsConstructor;
9 import lombok.Builder;
10 import lombok.EqualsAndHashCode;
11 import lombok.Getter;
12 import lombok.NoArgsConstructor;
13 import lombok.Setter;
14
15 import org.springframework.security.core.GrantedAuthority;
16
17 import java.util.HashSet;
18 import java.util.Map;
19 import java.util.Set;
20
21
22
23
24
25
26 @Builder(builderMethodName = "userDetailsBuilder")
27 @AllArgsConstructor
28 @NoArgsConstructor
29 @EqualsAndHashCode(callSuper = true)
30 @Setter(PROTECTED)
31 @Getter
32 @ApiModel
33 @SuppressWarnings("PMD")
34 public class UserDetails extends AbstractUser {
35
36 @ApiModelProperty(dataType = "java.lang.String", example = "ADMIN,USER,OTHER")
37 private Set<GrantedAuthority> authorities = new HashSet<>();
38
39 private boolean enabled;
40
41 private String id;
42
43 private String name;
44
45 private String password;
46
47 private Map<String, String> properties;
48 }