|
@@ -31,8 +31,6 @@ import java.util.stream.Collectors;
|
|
|
public class UserAccount extends BaseObject<Integer> implements UserDetails {
|
|
public class UserAccount extends BaseObject<Integer> implements UserDetails {
|
|
|
@NotNull
|
|
@NotNull
|
|
|
private Long userId;
|
|
private Long userId;
|
|
|
- private Integer accountType;
|
|
|
|
|
- @NotNull
|
|
|
|
|
@NotBlank
|
|
@NotBlank
|
|
|
@Length(min = 4, max = 16, message = "用户名仅可包含数字,大小写字母和 '-' 等字符, 长度为 4 ~ 16 个字符")
|
|
@Length(min = 4, max = 16, message = "用户名仅可包含数字,大小写字母和 '-' 等字符, 长度为 4 ~ 16 个字符")
|
|
|
private String username;
|
|
private String username;
|
|
@@ -42,72 +40,57 @@ public class UserAccount extends BaseObject<Integer> implements UserDetails {
|
|
|
private String encodedPassword;
|
|
private String encodedPassword;
|
|
|
private String salt;
|
|
private String salt;
|
|
|
private LocalDateTime createAt;
|
|
private LocalDateTime createAt;
|
|
|
- private Boolean notify;
|
|
|
|
|
- @Deprecated
|
|
|
|
|
- private String roles;
|
|
|
|
|
|
|
+ private String screenName;
|
|
|
|
|
+ private String avatarUrl;
|
|
|
|
|
|
|
|
private transient int loginType;
|
|
private transient int loginType;
|
|
|
private transient int plat;
|
|
private transient int plat;
|
|
|
// Spring Security 使用的字段
|
|
// Spring Security 使用的字段
|
|
|
- private transient Set<UserAuthority> authorities = new HashSet<>();
|
|
|
|
|
- @Deprecated
|
|
|
|
|
- private String role;
|
|
|
|
|
|
|
+ private transient Set<UserAuthority> authorities;
|
|
|
private Boolean enabled;
|
|
private Boolean enabled;
|
|
|
private Boolean locked;
|
|
private Boolean locked;
|
|
|
|
|
|
|
|
- private String screenName;
|
|
|
|
|
- private String avatarUrl;
|
|
|
|
|
- private String signature;
|
|
|
|
|
- private Integer gender;
|
|
|
|
|
-
|
|
|
|
|
public UserAccount(long userId, String email, String mobile, String avatarUrl) {
|
|
public UserAccount(long userId, String email, String mobile, String avatarUrl) {
|
|
|
this.userId = userId;
|
|
this.userId = userId;
|
|
|
- this.accountType = AccountType.tnb.getValue();
|
|
|
|
|
this.username = String.format("tnb_%s", userId);
|
|
this.username = String.format("tnb_%s", userId);
|
|
|
this.email = email;
|
|
this.email = email;
|
|
|
this.mobile = mobile;
|
|
this.mobile = mobile;
|
|
|
this.encodedPassword = "";
|
|
this.encodedPassword = "";
|
|
|
this.salt = "";
|
|
this.salt = "";
|
|
|
this.createAt = LocalDateTime.now();
|
|
this.createAt = LocalDateTime.now();
|
|
|
- this.notify = false;
|
|
|
|
|
- //this.role = AccountRole.user.getValue();
|
|
|
|
|
this.enabled = true;
|
|
this.enabled = true;
|
|
|
this.locked = false;
|
|
this.locked = false;
|
|
|
this.screenName = this.username;
|
|
this.screenName = this.username;
|
|
|
this.avatarUrl = avatarUrl;
|
|
this.avatarUrl = avatarUrl;
|
|
|
- this.gender = 2;
|
|
|
|
|
|
|
+ this.authorities = Set.of(new UserAuthority());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public UserAccount(long userId, String email, String mobile, String encodedPassword, String salt, String avatarUrl) {
|
|
public UserAccount(long userId, String email, String mobile, String encodedPassword, String salt, String avatarUrl) {
|
|
|
this.userId = userId;
|
|
this.userId = userId;
|
|
|
- this.accountType = AccountType.tnb.getValue();
|
|
|
|
|
this.username = String.format("tnb_%s", userId);
|
|
this.username = String.format("tnb_%s", userId);
|
|
|
this.mobile = mobile;
|
|
this.mobile = mobile;
|
|
|
this.email = email;
|
|
this.email = email;
|
|
|
this.encodedPassword = encodedPassword;
|
|
this.encodedPassword = encodedPassword;
|
|
|
this.salt = salt;
|
|
this.salt = salt;
|
|
|
this.createAt = LocalDateTime.now();
|
|
this.createAt = LocalDateTime.now();
|
|
|
- this.notify = false;
|
|
|
|
|
- //this.role = AccountRole.user.getValue();
|
|
|
|
|
this.enabled = true;
|
|
this.enabled = true;
|
|
|
this.locked = false;
|
|
this.locked = false;
|
|
|
this.screenName = this.username;
|
|
this.screenName = this.username;
|
|
|
this.avatarUrl = avatarUrl;
|
|
this.avatarUrl = avatarUrl;
|
|
|
- this.gender = 2;
|
|
|
|
|
|
|
+ this.authorities = Set.of(new UserAuthority());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Deprecated
|
|
@Deprecated
|
|
|
public UserAccount(long userId, String email, String username, String screenName, String avatarUrl) {
|
|
public UserAccount(long userId, String email, String username, String screenName, String avatarUrl) {
|
|
|
this.userId = userId;
|
|
this.userId = userId;
|
|
|
- this.accountType = AccountType.bilibili.getValue();
|
|
|
|
|
this.username = username;
|
|
this.username = username;
|
|
|
this.email = email;
|
|
this.email = email;
|
|
|
this.createAt = LocalDateTime.now();
|
|
this.createAt = LocalDateTime.now();
|
|
|
- //this.role = AccountRole.user.getValue();
|
|
|
|
|
this.enabled = true;
|
|
this.enabled = true;
|
|
|
this.locked = false;
|
|
this.locked = false;
|
|
|
this.screenName = screenName;
|
|
this.screenName = screenName;
|
|
|
this.avatarUrl = avatarUrl;
|
|
this.avatarUrl = avatarUrl;
|
|
|
|
|
+ this.authorities = Set.of(new UserAuthority());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|