41 changed files with 364 additions and 212 deletions
@ -0,0 +1,134 @@
@@ -0,0 +1,134 @@
|
||||
package com.cloud.kicc.common.data.entity; |
||||
|
||||
import com.cloud.kicc.common.core.enums.CasSystemEnum; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import lombok.experimental.Accessors; |
||||
import org.springframework.security.core.GrantedAuthority; |
||||
import org.springframework.security.core.userdetails.User; |
||||
|
||||
import java.time.LocalDateTime; |
||||
import java.util.Collection; |
||||
import java.util.Map; |
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
|
||||
/** |
||||
*<p> |
||||
* CAS统一认证用户数据 |
||||
*</p> |
||||
* |
||||
* @Author: wangxiang4 |
||||
* @Since: 2023/8/16 |
||||
*/ |
||||
@Setter |
||||
@Getter |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
public class CasUser extends User { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
/** 用户ID */ |
||||
private String id; |
||||
|
||||
/** 昵称 */ |
||||
private String nickName; |
||||
|
||||
/** 邮箱 */ |
||||
private String email; |
||||
|
||||
/** 手机号 */ |
||||
private String phone; |
||||
|
||||
/** 性别 */ |
||||
private String sex; |
||||
|
||||
/** 头像地址 */ |
||||
private String avatar; |
||||
|
||||
/** 最后登陆ip */ |
||||
private String loginIp; |
||||
|
||||
/** 最后登陆时间 */ |
||||
private LocalDateTime loginTime; |
||||
|
||||
/** 创建ID */ |
||||
private String createById; |
||||
|
||||
/** 创建人 */ |
||||
private String createByName; |
||||
|
||||
/** 创建时间 */ |
||||
private LocalDateTime createTime; |
||||
|
||||
/** 更新id */ |
||||
private String updateById; |
||||
|
||||
/** 更新者 */ |
||||
private String updateByName; |
||||
|
||||
/** 更新时间 */ |
||||
private LocalDateTime updateTime; |
||||
|
||||
/** 备注 */ |
||||
private String remarks; |
||||
|
||||
/** 多租户ID */ |
||||
private String tenantId; |
||||
|
||||
/** sso扩展信息 */ |
||||
private Map<CasSystemEnum, String> exPrincipals = new ConcurrentHashMap<>(3); |
||||
|
||||
|
||||
public CasUser(String username, String password, Collection<? extends GrantedAuthority> authorities) { |
||||
super(username, password, authorities); |
||||
} |
||||
|
||||
public CasUser(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) { |
||||
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); |
||||
} |
||||
|
||||
public CasUser(String username, |
||||
String password, |
||||
boolean enabled, |
||||
boolean accountNonExpired, |
||||
boolean credentialsNonExpired, |
||||
boolean accountNonLocked, |
||||
Collection<? extends GrantedAuthority> authorities, |
||||
String id, |
||||
String nickName, |
||||
String email, |
||||
String phone, |
||||
String sex, |
||||
String avatar, |
||||
String loginIp, |
||||
LocalDateTime loginTime, |
||||
String createById, |
||||
String createByName, |
||||
LocalDateTime createTime, |
||||
String updateById, |
||||
String updateByName, |
||||
LocalDateTime updateTime, |
||||
String remarks, |
||||
String tenantId) { |
||||
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); |
||||
this.id = id; |
||||
this.nickName = nickName; |
||||
this.email = email; |
||||
this.phone = phone; |
||||
this.sex = sex; |
||||
this.avatar = avatar; |
||||
this.loginIp = loginIp; |
||||
this.loginTime = loginTime; |
||||
this.createById = createById; |
||||
this.createByName = createByName; |
||||
this.createTime = createTime; |
||||
this.updateById = updateById; |
||||
this.updateByName = updateByName; |
||||
this.updateTime = updateTime; |
||||
this.remarks = remarks; |
||||
this.tenantId = tenantId; |
||||
} |
||||
|
||||
} |
@ -1,74 +1,35 @@
@@ -1,74 +1,35 @@
|
||||
package com.cloud.kicc.common.data.entity; |
||||
|
||||
import com.cloud.kicc.common.core.constant.SecurityConstants; |
||||
import lombok.AllArgsConstructor; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
import lombok.NoArgsConstructor; |
||||
import lombok.experimental.Accessors; |
||||
import org.springframework.security.core.GrantedAuthority; |
||||
import org.springframework.security.core.userdetails.User; |
||||
|
||||
import java.util.Collection; |
||||
import java.util.Map; |
||||
import java.util.concurrent.ConcurrentHashMap; |
||||
import java.util.Set; |
||||
|
||||
/** |
||||
*<p> |
||||
* 扩展安全框架用户信息 |
||||
* 扩展用户数据 |
||||
*</p> |
||||
* |
||||
* @Author: wangxiang4 |
||||
* @Since: 2023/8/16 |
||||
*/ |
||||
@Getter |
||||
@Data |
||||
@Accessors(chain = true) |
||||
@EqualsAndHashCode(callSuper = false) |
||||
public class KiccUser extends User { |
||||
@AllArgsConstructor |
||||
@NoArgsConstructor |
||||
public class KiccUser { |
||||
|
||||
private static final long serialVersionUID = 999L; |
||||
/** 部门ID */ |
||||
private String deptId; |
||||
|
||||
/** |
||||
* 用户ID |
||||
*/ |
||||
private final String id; |
||||
|
||||
/** |
||||
* 部门ID |
||||
*/ |
||||
private final String deptId; |
||||
|
||||
/** |
||||
* 手机号 |
||||
*/ |
||||
private final String phone; |
||||
|
||||
/** |
||||
* 用户类型 |
||||
*/ |
||||
private final String userType; |
||||
|
||||
/** |
||||
* 扩展sso多系统角色权限 |
||||
*/ |
||||
@Setter |
||||
private Map<String, Collection<? extends GrantedAuthority>> ssoPermissions = new ConcurrentHashMap<>(3); |
||||
/** 用户类型 */ |
||||
private String userType; |
||||
|
||||
/** |
||||
* 多租户ID |
||||
*/ |
||||
@Setter |
||||
private String tenantId; |
||||
|
||||
public KiccUser(String id, String deptId, String username, String password, String phone, String userType, String tenantId, boolean enabled, |
||||
boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, |
||||
Collection<? extends GrantedAuthority> authorities) { |
||||
super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); |
||||
this.id = id; |
||||
this.deptId = deptId; |
||||
this.phone = phone; |
||||
this.userType = userType; |
||||
this.tenantId = tenantId; |
||||
this.ssoPermissions.put(SecurityConstants.SSO_PERMISSION, authorities); |
||||
} |
||||
/** 扩展用户权限 */ |
||||
private Set<String> exPermissions; |
||||
|
||||
} |
||||
|
Loading…
Reference in new issue