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 deptId; public MyUser(String username, String password, Collection authorities, Integer role, List 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 authorities, Integer role, List deptId) { super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); this.role = role; this.deptId = deptId; } }