update 增加多个方法的注释以提升代码可读性
This commit is contained in:
+21
@@ -48,14 +48,35 @@ public class PathNamedTemplate implements Template {
|
||||
return delegate.render(bindingMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建带路径名称的模板。
|
||||
*
|
||||
* @param pathName 路径名称
|
||||
* @param delegate 模板对象
|
||||
* @return 带路径名称的模板
|
||||
*/
|
||||
public static PathNamedTemplate form(String pathName, Template delegate) {
|
||||
return new PathNamedTemplate(pathName, delegate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据模板引擎和路径名称构建模板。
|
||||
*
|
||||
* @param templateEngine 模板引擎
|
||||
* @param pathName 路径名称
|
||||
* @return 带路径名称的模板
|
||||
*/
|
||||
public static PathNamedTemplate form(TemplateEngine templateEngine,String pathName) {
|
||||
return new PathNamedTemplate(pathName,templateEngine.getTemplate(pathName));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据模板引擎和路径名称集合构建模板映射。
|
||||
*
|
||||
* @param templateEngine 模板引擎
|
||||
* @param pathNames 路径名称集合
|
||||
* @return 模板映射
|
||||
*/
|
||||
public static Map<String, PathNamedTemplate> form(TemplateEngine templateEngine, Set<String> pathNames) {
|
||||
Map<String, PathNamedTemplate> result = new HashMap<>();
|
||||
for (String pathName : pathNames) {
|
||||
|
||||
@@ -104,10 +104,20 @@ public class SysUser extends BaseEntity {
|
||||
private String remark;
|
||||
|
||||
|
||||
/**
|
||||
* 使用用户ID构造系统用户对象。
|
||||
*
|
||||
* @param userId 用户ID
|
||||
*/
|
||||
public SysUser(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断当前用户是否为超级管理员。
|
||||
*
|
||||
* @return true 是超级管理员 false 不是超级管理员
|
||||
*/
|
||||
public boolean isSuperAdmin() {
|
||||
return SystemConstants.SUPER_ADMIN_USER_ID.equals(this.userId);
|
||||
}
|
||||
|
||||
@@ -88,6 +88,11 @@ public class SysRoleBo implements Serializable {
|
||||
*/
|
||||
private Long[] deptIds;
|
||||
|
||||
/**
|
||||
* 判断当前角色是否为超级管理员角色。
|
||||
*
|
||||
* @return true 是超级管理员角色 false 不是超级管理员角色
|
||||
*/
|
||||
public boolean isSuperAdmin() {
|
||||
return SystemConstants.SUPER_ADMIN_ROLE_ID.equals(this.roleId);
|
||||
}
|
||||
|
||||
@@ -133,6 +133,11 @@ public class SysUserBo implements Serializable {
|
||||
*/
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
|
||||
/**
|
||||
* 判断当前用户是否为超级管理员。
|
||||
*
|
||||
* @return true 是超级管理员 false 不是超级管理员
|
||||
*/
|
||||
public boolean isSuperAdmin() {
|
||||
return SystemConstants.SUPER_ADMIN_USER_ID.equals(this.userId);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,11 @@ public class SysRoleVo implements Serializable {
|
||||
*/
|
||||
private boolean flag = false;
|
||||
|
||||
/**
|
||||
* 判断当前角色是否为超级管理员角色。
|
||||
*
|
||||
* @return true 是超级管理员角色 false 不是超级管理员角色
|
||||
*/
|
||||
public boolean isSuperAdmin() {
|
||||
return SystemConstants.SUPER_ADMIN_ROLE_ID.equals(this.roleId);
|
||||
}
|
||||
|
||||
@@ -165,6 +165,12 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo>, MPJBa
|
||||
})
|
||||
int updateById(@Param(Constants.ENTITY) SysUser user);
|
||||
|
||||
/**
|
||||
* 构建用户与角色关联查询条件
|
||||
*
|
||||
* @param user 查询条件
|
||||
* @return 用户角色关联查询包装器
|
||||
*/
|
||||
default MPJLambdaWrapper<SysUser> buildUserRoleJoinWrapper(SysUserBo user) {
|
||||
return JoinWrappers.lambda("u", SysUser.class)
|
||||
.distinct()
|
||||
|
||||
+5
@@ -19,6 +19,11 @@ public class SystemApplicationRunner implements ApplicationRunner {
|
||||
|
||||
private final ISysOssConfigService ossConfigService;
|
||||
|
||||
/**
|
||||
* 应用启动后初始化 OSS 配置缓存。
|
||||
*
|
||||
* @param args 启动参数
|
||||
*/
|
||||
@Override
|
||||
public void run(ApplicationArguments args) throws Exception {
|
||||
ossConfigService.init();
|
||||
|
||||
+2
-3
@@ -110,7 +110,7 @@ public interface ISysMenuService {
|
||||
/**
|
||||
* 是否存在菜单子节点
|
||||
*
|
||||
* @param menuIds 菜单ID串
|
||||
* @param menuIds 菜单ID列表
|
||||
* @return 结果 true 存在 false 不存在
|
||||
*/
|
||||
boolean hasChildByMenuId(Collection<Long> menuIds);
|
||||
@@ -150,8 +150,7 @@ public interface ISysMenuService {
|
||||
/**
|
||||
* 批量删除菜单管理信息
|
||||
*
|
||||
* @param menuIds 菜单ID串
|
||||
* @return 结果
|
||||
* @param menuIds 菜单ID列表
|
||||
*/
|
||||
void deleteMenuById(Collection<Long> menuIds);
|
||||
|
||||
|
||||
+3
-3
@@ -110,7 +110,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户ID查询菜单
|
||||
* 根据用户ID查询菜单树信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 按树结构组织的菜单列表
|
||||
@@ -251,7 +251,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||
/**
|
||||
* 是否存在菜单子节点
|
||||
*
|
||||
* @param menuIds 菜单ID串
|
||||
* @param menuIds 菜单ID列表
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@@ -337,7 +337,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验路由名称是否唯一
|
||||
* 校验路由组合是否唯一
|
||||
*
|
||||
* @param menuBo 菜单信息
|
||||
* @return 结果
|
||||
|
||||
Reference in New Issue
Block a user