|
@@ -1,74 +1,159 @@
|
|
|
package com.tofly.common.oauth.auth;
|
|
|
|
|
|
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 Administrator
|
|
|
* @date 2019/10/12 13:06
|
|
|
*/
|
|
|
+@Getter
|
|
|
+@Setter
|
|
|
public class ToflyUser extends User{
|
|
|
|
|
|
- @Getter
|
|
|
- private Long userid;
|
|
|
+
|
|
|
+ * 用户ID,主键
|
|
|
+ */
|
|
|
|
|
|
- @Getter
|
|
|
- private Long departmentId;
|
|
|
+ private Long id;
|
|
|
|
|
|
- @Getter
|
|
|
- private String userLevel;
|
|
|
+
|
|
|
+ * 电话
|
|
|
+ */
|
|
|
+ private String phone;
|
|
|
|
|
|
- @Getter
|
|
|
+
|
|
|
+ * 头像
|
|
|
+ */
|
|
|
+ private String avatar;
|
|
|
+
|
|
|
+
|
|
|
+ * 是否锁定,1正常,0锁定
|
|
|
+ */
|
|
|
+ private Integer lockFlag;
|
|
|
+
|
|
|
+
|
|
|
+ * 是否启用禁用,1启用,0禁用
|
|
|
+ */
|
|
|
+ private Integer active;
|
|
|
+
|
|
|
+
|
|
|
+ * 密码错误次数
|
|
|
+ */
|
|
|
+ private Integer loginFail;
|
|
|
+
|
|
|
+
|
|
|
+ * 用户email
|
|
|
+ */
|
|
|
+ private String email;
|
|
|
+
|
|
|
+
|
|
|
+ * 用户姓名
|
|
|
+ */
|
|
|
private String realName;
|
|
|
|
|
|
- @Getter
|
|
|
- private String departemntName;
|
|
|
|
|
|
- @Getter
|
|
|
- private String avatar;
|
|
|
+
|
|
|
+ * 工号
|
|
|
+ */
|
|
|
+ private String jobNumber;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ * 别名
|
|
|
+ */
|
|
|
+ private String aliasName;
|
|
|
+
|
|
|
|
|
|
- @Getter
|
|
|
- private Short pwderrtimes;
|
|
|
- @Getter
|
|
|
- private Long parentCompanyId;
|
|
|
- @Getter
|
|
|
- private String parentCompanyName;
|
|
|
- @Getter
|
|
|
- private Long companyId;
|
|
|
- @Getter
|
|
|
- private String companyName;
|
|
|
-
|
|
|
-
|
|
|
- public ToflyUser(Short pwderrtimes,Long parentCompanyId,String parentCompanyName,Long companyId,String companyName,Long useid,Long departmentId,String userLevel,String realName, String departemntName,String avatar,
|
|
|
- String username, String password, boolean enabled, boolean accountNonExpired,
|
|
|
- boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
|
|
|
+
|
|
|
+ * 用户级别 用于超级管理员与其他用户区分等 。0 超级管理员1普通管理员,2其他公司管理员
|
|
|
+ */
|
|
|
+ private Integer userLevel;
|
|
|
+
|
|
|
+
|
|
|
+ * 公司ID
|
|
|
+ */
|
|
|
+ private Long tenantId;
|
|
|
+
|
|
|
+
|
|
|
+ * 角色ID集合
|
|
|
+ */
|
|
|
+ private List<Long> roleIds;
|
|
|
+
|
|
|
+
|
|
|
+ * 部门ID集合
|
|
|
+ */
|
|
|
+ private List<Long> deptIds;
|
|
|
+
|
|
|
+
|
|
|
+ * 岗位ID集合
|
|
|
+ */
|
|
|
+ private List<Long> postIds;
|
|
|
+
|
|
|
+ public ToflyUser(String username, String password, Collection<? extends GrantedAuthority> authorities) {
|
|
|
+ super(username, password, authorities);
|
|
|
+ }
|
|
|
+
|
|
|
+ public ToflyUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired,
|
|
|
+ boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
|
|
|
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
|
|
|
- this.parentCompanyId = parentCompanyId;
|
|
|
- this.parentCompanyName = parentCompanyName;
|
|
|
- this.companyId = companyId;
|
|
|
- this.companyName = companyName;
|
|
|
- this.userid=useid;
|
|
|
- this.departmentId=departmentId;
|
|
|
- this.userLevel=userLevel;
|
|
|
- this.realName=realName;
|
|
|
- this.departemntName=departemntName;
|
|
|
- this.avatar=avatar;
|
|
|
- this.pwderrtimes=pwderrtimes;
|
|
|
}
|
|
|
|
|
|
- public ToflyUser(Short pwderrtimes,Long useid,Long departmentId,String userLevel,String realName, String departemntName,String avatar,
|
|
|
- String username, String password, boolean enabled, boolean accountNonExpired,
|
|
|
- boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) {
|
|
|
+ public ToflyUser(String username, String password, Collection<? extends GrantedAuthority> authorities,
|
|
|
+ Long id, String phone, String avatar, Integer lockFlag,
|
|
|
+ Integer active, String email,
|
|
|
+ String realName, Integer loginFail,
|
|
|
+ String jobNumber,
|
|
|
+ Integer userLevel,
|
|
|
+ Long tenantId,
|
|
|
+ List<Long> roleIds, List<Long> deptIds, List<Long> postIds) {
|
|
|
+ super(username, password, authorities);
|
|
|
+ this.id = id;
|
|
|
+ this.loginFail = loginFail;
|
|
|
+ this.phone = phone;
|
|
|
+ this.avatar = avatar;
|
|
|
+ this.lockFlag = lockFlag;
|
|
|
+ this.active = active;
|
|
|
+ this.email = email;
|
|
|
+ this.realName = realName;
|
|
|
+ this.jobNumber = jobNumber;
|
|
|
+ this.userLevel = userLevel;
|
|
|
+ this.tenantId = tenantId;
|
|
|
+ this.roleIds = roleIds;
|
|
|
+ this.deptIds = deptIds;
|
|
|
+ this.postIds = postIds;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ToflyUser(String username, String password, boolean enabled, boolean accountNonExpired,
|
|
|
+ boolean credentialsNonExpired, boolean accountNonLocked,
|
|
|
+ Collection<? extends GrantedAuthority> authorities, Long id,
|
|
|
+ String phone, String avatar, Integer lockFlag,
|
|
|
+ Integer active,Integer loginFail,
|
|
|
+ String realName,
|
|
|
+ String jobNumber,
|
|
|
+ Integer userLevel,
|
|
|
+ Long tenantId,
|
|
|
+ List<Long> roleIds, List<Long> deptIds, List<Long> postIds) {
|
|
|
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities);
|
|
|
- this.userid=useid;
|
|
|
- this.departmentId=departmentId;
|
|
|
- this.userLevel=userLevel;
|
|
|
- this.realName=realName;
|
|
|
- this.departemntName=departemntName;
|
|
|
- this.avatar=avatar;
|
|
|
- this.pwderrtimes=pwderrtimes;
|
|
|
+ this.id = id;
|
|
|
+ this.loginFail = loginFail;
|
|
|
+ this.phone = phone;
|
|
|
+ this.avatar = avatar;
|
|
|
+ this.lockFlag = lockFlag;
|
|
|
+ this.active = active;
|
|
|
+ this.email = email;
|
|
|
+ this.realName = realName;
|
|
|
+ this.jobNumber = jobNumber;
|
|
|
+ this.aliasName = aliasName;
|
|
|
+ this.userLevel = userLevel;
|
|
|
+ this.tenantId = tenantId;
|
|
|
+ this.roleIds = roleIds;
|
|
|
+ this.deptIds = deptIds;
|
|
|
+ this.postIds = postIds;
|
|
|
}
|
|
|
}
|