init local code
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package com.yunhai.cms.model.vo;
|
||||
|
||||
import com.yunhai.platform.utils.model.BoaRoleInfo;
|
||||
import com.yunhai.platform.utils.model.BoaUser;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 管理端登录态:CAS 会话用户 + 可管理站点 + 是否超管(方案 §7.2 权限规则的客户端镜像)。
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class AuthUserVo {
|
||||
|
||||
/** 登录账号 */
|
||||
private String account;
|
||||
|
||||
/** 姓名 */
|
||||
private String name;
|
||||
|
||||
/** 当前角色(roleId/roleName/schId/schName) */
|
||||
private BoaRoleInfo currentRole;
|
||||
|
||||
/** 是否平台超管(BoaUser.type == 1,平台约定) */
|
||||
private boolean superAdmin;
|
||||
|
||||
/** 可管理的站点(超管=全部;校级=本校站点) */
|
||||
private List<SiteVo> sites;
|
||||
|
||||
/** 角色集合(前端判断用) */
|
||||
private List<Integer> roleIds;
|
||||
|
||||
public static AuthUserVo of(BoaUser user, boolean superAdmin, List<SiteVo> sites) {
|
||||
return AuthUserVo.builder()
|
||||
.account(user.getAccount())
|
||||
.name(user.getName())
|
||||
.currentRole(user.getCurrentRole())
|
||||
.superAdmin(superAdmin)
|
||||
.sites(sites)
|
||||
.roleIds(user.getRoleIds())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user