temp
This commit is contained in:
22
urbanLifelineServ/apis/api-system/pom.xml
Normal file
22
urbanLifelineServ/apis/api-system/pom.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.xyzh</groupId>
|
||||
<artifactId>apis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-system</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,230 @@
|
||||
package org.xyzh.api.system.service;
|
||||
|
||||
import org.xyzh.api.system.vo.PermissionVO;
|
||||
import org.xyzh.api.system.vo.UserDeptRoleVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
import org.xyzh.common.dto.sys.TbSysDeptDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysDeptRoleDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysRoleDTO;
|
||||
|
||||
/**
|
||||
* @description 部门角色服务接口
|
||||
* @filename DeptRoleService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
public interface DeptRoleService {
|
||||
|
||||
// ================= 部门管理 =================
|
||||
/**
|
||||
* @description 插入部门
|
||||
* @param deptDTO 部门DTO
|
||||
* @return ResultDomain<TbSysDeptDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysDeptDTO> insertDept(TbSysDeptDTO deptDTO);
|
||||
|
||||
/**
|
||||
* @description 更新部门
|
||||
* @param deptDTO 部门DTO
|
||||
* @return ResultDomain<TbSysDeptDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysDeptDTO> updateDept(TbSysDeptDTO deptDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除部门
|
||||
* @param deptDTO 部门DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteDept(TbSysDeptDTO deptDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID查询部门
|
||||
* @param filter 部门VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDept(UserDeptRoleVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询部门列表
|
||||
* @param filter 部门VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptList(UserDeptRoleVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询部门分页列表
|
||||
* @param pageRequest 部门VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptPage(PageRequest<UserDeptRoleVO> pageRequest);
|
||||
|
||||
/**
|
||||
* @description 获取部门树
|
||||
* @param filter 部门VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptTree(UserDeptRoleVO filter);
|
||||
|
||||
// ================= 角色管理 =================
|
||||
/**
|
||||
* @description 插入角色
|
||||
* @param roleDTO 角色DTO
|
||||
* @return ResultDomain<TbSysRoleDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysRoleDTO> insertRole(TbSysRoleDTO roleDTO);
|
||||
|
||||
/**
|
||||
* @description 更新角色
|
||||
* @param roleDTO 角色DTO
|
||||
* @return ResultDomain<TbSysRoleDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysRoleDTO> updateRole(TbSysRoleDTO roleDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除角色
|
||||
* @param roleDTO 角色DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteRole(TbSysRoleDTO roleDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID查询角色
|
||||
* @param filter 角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getRole(UserDeptRoleVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询角色列表
|
||||
* @param filter 角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getRoleList(UserDeptRoleVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询角色分页列表
|
||||
* @param pageRequest 角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getRolePage(PageRequest<UserDeptRoleVO> pageRequest);
|
||||
|
||||
/**
|
||||
* @description 根据部门ID获取角色列表
|
||||
* @param deptId 部门ID
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getRoleListByDeptId(String deptId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID获取角色列表
|
||||
* @param userId 用户ID
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getRoleListByUserId(String userId);
|
||||
|
||||
// ================= 部门角色关联管理 =================
|
||||
/**
|
||||
* @description 插入部门角色关联
|
||||
* @param deptRoleDTO 部门角色DTO
|
||||
* @return ResultDomain<TbSysDeptRoleDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysDeptRoleDTO> insertDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 更新部门角色关联
|
||||
* @param deptRoleDTO 部门角色DTO
|
||||
* @return ResultDomain<TbSysDeptRoleDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysDeptRoleDTO> updateDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除部门角色关联
|
||||
* @param deptRoleDTO 部门角色DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteDeptRole(TbSysDeptRoleDTO deptRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID查询部门角色关联
|
||||
* @param filter 部门角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptRole(UserDeptRoleVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询部门角色关联列表
|
||||
* @param filter 部门角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptRoleList(UserDeptRoleVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询部门角色关联分页列表
|
||||
* @param pageRequest 部门角色VO
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getDeptRolePage(PageRequest<UserDeptRoleVO> pageRequest);
|
||||
|
||||
// ==================== 角色权限关联 ================================
|
||||
/**
|
||||
* @description 设置角色的权限
|
||||
* @param permissionVO 权限VO roleId对应多个permissionId
|
||||
* @return 返回值描述
|
||||
* @author yslg
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
ResultDomain<PermissionVO> setRolePermission(PermissionVO permissionVO);
|
||||
|
||||
/**
|
||||
* @description 获取角色的权限列表
|
||||
* @param permissionVO 权限VO
|
||||
* @return 返回值描述
|
||||
* @author yslg
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
ResultDomain<PermissionVO> getRolePermissionList(PermissionVO permissionVO);
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
package org.xyzh.api.system.service;
|
||||
|
||||
import org.xyzh.api.system.vo.PermissionVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.sys.TbSysModuleDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysPermissionDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysRolePermissionDTO;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
|
||||
/**
|
||||
* @description 模块权限服务接口
|
||||
* @filename ModulePermissionService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
public interface ModulePermissionService {
|
||||
|
||||
// ================= 模块管理 =================
|
||||
/**
|
||||
* @description 插入模块
|
||||
* @param moduleDTO 模块DTO
|
||||
* @return ResultDomain<TbSysModuleDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysModuleDTO> insertModule(TbSysModuleDTO moduleDTO);
|
||||
|
||||
/**
|
||||
* @description 更新模块
|
||||
* @param moduleDTO 模块DTO
|
||||
* @return ResultDomain<TbSysModuleDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysModuleDTO> updateModule(TbSysModuleDTO moduleDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除模块
|
||||
* @param moduleDTO 模块DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteModule(TbSysModuleDTO moduleDTO);
|
||||
|
||||
/**
|
||||
* @description 获取模块分页数据
|
||||
* @param
|
||||
* @return 返回值描述
|
||||
* @author yslg
|
||||
* @since 2025-11-10
|
||||
*/
|
||||
ResultDomain<PermissionVO> getModulePage(PageRequest<PermissionVO> pageRequest);
|
||||
|
||||
/**
|
||||
* @description 查询模块列表
|
||||
* @param filter 模块VO
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getModuleList(PermissionVO filter);
|
||||
|
||||
// ================= 权限管理 =================
|
||||
/**
|
||||
* @description 插入权限
|
||||
* @param permissionDTO 权限DTO
|
||||
* @return ResultDomain<TbSysPermissionDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysPermissionDTO> insertPermission(TbSysPermissionDTO permissionDTO);
|
||||
|
||||
/**
|
||||
* @description 更新权限
|
||||
* @param permissionDTO 权限DTO
|
||||
* @return ResultDomain<TbSysPermissionDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysPermissionDTO> updatePermission(TbSysPermissionDTO permissionDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除权限
|
||||
* @param permissionDTO 权限DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deletePermission(TbSysPermissionDTO permissionDTO);
|
||||
|
||||
/**
|
||||
* @description 根据模块ID获取权限列表
|
||||
* @param moduleId 模块ID
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getPermissionListByModuleId(String moduleId);
|
||||
|
||||
|
||||
// ================= 模块权限查询 =================
|
||||
/**
|
||||
* @description 根据条件查询模块权限
|
||||
* @param filter 模块权限VO
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getModulePermission(PermissionVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询模块权限列表
|
||||
* @param filter 模块权限VO
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getModulePermissionList(PermissionVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询模块权限分页列表
|
||||
* @param pageRequest 模块权限VO
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getModulePermissionPage(PageRequest<PermissionVO> pageRequest);
|
||||
|
||||
/**
|
||||
* @description 根据角色ID获取模块权限列表
|
||||
* @param roleId 角色ID
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getModulePermissionListByRoleId(String roleId);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID获取用户的所有权限
|
||||
* @param userId 用户ID
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getUserPermissions(String userId);
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package org.xyzh.api.system.service;
|
||||
|
||||
import org.xyzh.api.system.vo.SysConfigVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
import org.xyzh.common.dto.sys.TbSysConfigDTO;
|
||||
|
||||
/**
|
||||
* @description 系统配置服务接口
|
||||
* @filename SysConfigService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
public interface SysConfigService {
|
||||
|
||||
/**
|
||||
* @description 插入系统配置
|
||||
* @param configDTO 系统配置DTO
|
||||
* @return ResultDomain<TbSysConfigDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysConfigDTO> insertConfig(TbSysConfigDTO configDTO);
|
||||
|
||||
/**
|
||||
* @description 更新系统配置
|
||||
* @param configDTO 系统配置DTO
|
||||
* @return ResultDomain<TbSysConfigDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysConfigDTO> updateConfig(TbSysConfigDTO configDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除系统配置
|
||||
* @param configDTO 系统配置DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteConfig(TbSysConfigDTO configDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID查询系统配置
|
||||
* @param filter 系统配置VO
|
||||
* @return ResultDomain<SysConfigVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysConfigVO> getConfig(SysConfigVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询系统配置列表
|
||||
* @param filter 系统配置VO
|
||||
* @return ResultDomain<SysConfigVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysConfigVO> getConfigList(SysConfigVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询系统配置分页列表
|
||||
* @param filter 系统配置VO
|
||||
* @return ResultDomain<SysConfigVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysConfigVO> getConfigPage(PageRequest<SysConfigVO> filter);
|
||||
|
||||
/**
|
||||
* @description 根据配置键获取配置值
|
||||
* @param key 配置键
|
||||
* @return ResultDomain<String> 配置值
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<String> getConfigValueByKey(String key);
|
||||
|
||||
/**
|
||||
* @description 根据模块ID获取配置列表
|
||||
* @param moduleId 模块ID
|
||||
* @return ResultDomain<SysConfigVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysConfigVO> getConfigListByModuleId(String moduleId);
|
||||
}
|
||||
@@ -0,0 +1,180 @@
|
||||
package org.xyzh.api.system.service;
|
||||
|
||||
import org.xyzh.api.system.vo.SysUserVO;
|
||||
import org.xyzh.api.system.vo.UserDeptRoleVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
import org.xyzh.common.dto.sys.TbSysUserDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysUserInfoDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysUserRoleDTO;
|
||||
|
||||
/**
|
||||
* @description 用户服务接口
|
||||
* @filename SysUserService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
public interface SysUserService {
|
||||
|
||||
// ================= 用户基本信息管理 =================
|
||||
/**
|
||||
* @description 插入用户
|
||||
* @param userVO 用户VO
|
||||
* @return ResultDomain<TbSysUserDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysUserDTO> insertUser(SysUserVO userVO);
|
||||
|
||||
/**
|
||||
* @description 更新用户
|
||||
* @param userVO 用户VO
|
||||
* @return ResultDomain<TbSysUserDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysUserDTO> updateUser(SysUserVO userVO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除用户
|
||||
* @param TbSysUserDTO userDTO 用户DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteUser(TbSysUserDTO userDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID查询用户
|
||||
* @param filter 用户VO
|
||||
* @return ResultDomain<SysUserVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysUserVO> getUser(SysUserVO filter);
|
||||
|
||||
/**
|
||||
* @description 用户登录查询
|
||||
* @param filter 用户VO
|
||||
* @return ResultDomain<SysUserVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysUserVO> getLoginUser(SysUserVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询用户列表
|
||||
* @param filter 用户VO
|
||||
* @return ResultDomain<SysUserVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysUserVO> getUserList(SysUserVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询用户分页列表
|
||||
* @param filter 用户VO
|
||||
* @return ResultDomain<SysUserVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysUserVO> getUserPage(PageRequest<SysUserVO> pageRequest);
|
||||
|
||||
/**
|
||||
* @description 根据用户名查询用户
|
||||
* @param username 用户名
|
||||
* @return ResultDomain<SysUserVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysUserVO> getUserByUsername(String username);
|
||||
|
||||
/**
|
||||
* @description 更新用户密码
|
||||
* @param userId 用户ID
|
||||
* @param oldPassword 旧密码
|
||||
* @param newPassword 新密码
|
||||
* @return ResultDomain<Boolean> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> updateUserPassword(String userId, String oldPassword, String newPassword);
|
||||
|
||||
/**
|
||||
* @description 重置用户密码
|
||||
* @param userId 用户ID
|
||||
* @return ResultDomain<String> 新密码
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<String> resetUserPassword(String userId);
|
||||
|
||||
/**
|
||||
* @description 更新用户状态
|
||||
* @param userId 用户ID
|
||||
* @param status 状态
|
||||
* @return ResultDomain<Boolean> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> updateUserStatus(String userId, String status);
|
||||
|
||||
// ================= 用户详细信息管理 =================
|
||||
/**
|
||||
* @description 更新用户详细信息
|
||||
* @param userInfoDTO 用户详细信息DTO
|
||||
* @return ResultDomain<TbSysUserInfoDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysUserInfoDTO> updateUserInfo(TbSysUserInfoDTO userInfoDTO);
|
||||
|
||||
/**
|
||||
* @description 根据用户ID获取用户详细信息
|
||||
* @param userId 用户ID
|
||||
* @return ResultDomain<SysUserVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<SysUserVO> getUserInfo(String userId);
|
||||
|
||||
// ================= 用户角色关联管理 =================
|
||||
/**
|
||||
* @description 添加用户角色关联
|
||||
* @param userRoleDTO 用户角色DTO
|
||||
* @return ResultDomain<TbSysUserRoleDTO> 添加结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysUserRoleDTO> addUserRole(TbSysUserRoleDTO userRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 删除用户角色关联
|
||||
* @param userRoleDTO 用户角色DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> removeUserRole(TbSysUserRoleDTO userRoleDTO);
|
||||
|
||||
/**
|
||||
* @description 批量设置用户角色
|
||||
* @param userId 用户ID
|
||||
* @param[] roleIds 角色ID数组
|
||||
* @return ResultDomain<Boolean> 设置结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> setUserRoles(String userId, String[] roleIds);
|
||||
|
||||
// ================= 用户完整信息查询 =================
|
||||
/**
|
||||
* @description 获取用户完整信息(包含部门和角色)
|
||||
* @param userId 用户ID
|
||||
* @return ResultDomain<UserDeptRoleVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<UserDeptRoleVO> getUserWithDeptRole(String userId);
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package org.xyzh.api.system.service;
|
||||
|
||||
import org.xyzh.api.system.vo.PermissionVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.dto.sys.TbSysViewDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysViewPermissionDTO;
|
||||
import org.xyzh.common.core.page.PageRequest;
|
||||
/**
|
||||
* @description 视图服务接口
|
||||
* @filename ViewService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
public interface ViewService {
|
||||
|
||||
// ================= 视图管理 =================
|
||||
/**
|
||||
* @description 插入视图
|
||||
* @param viewDTO 视图DTO
|
||||
* @return ResultDomain<TbSysViewDTO> 插入结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysViewDTO> insertView(TbSysViewDTO viewDTO);
|
||||
|
||||
/**
|
||||
* @description 更新视图
|
||||
* @param viewDTO 视图DTO
|
||||
* @return ResultDomain<TbSysViewDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbSysViewDTO> updateView(TbSysViewDTO viewDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID删除视图
|
||||
* @param viewDTO 视图DTO
|
||||
* @return ResultDomain<Boolean> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteView(TbSysViewDTO viewDTO);
|
||||
|
||||
/**
|
||||
* @description 根据ID查询视图
|
||||
* @param filter 视图VO
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getView(PermissionVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询视图列表
|
||||
* @param filter 视图VO
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getViewList(PermissionVO filter);
|
||||
|
||||
/**
|
||||
* @description 根据条件查询视图分页列表
|
||||
* @param filter 视图VO
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getViewPage(PageRequest<PermissionVO> filter);
|
||||
|
||||
/**
|
||||
* @description 获取视图树(包含子视图)
|
||||
* @param filter 视图VO
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getViewTree(PermissionVO filter);
|
||||
|
||||
// ================= 视图权限关联管理 =================
|
||||
/**
|
||||
* @description 设置视图权限
|
||||
* @param permissionVO 视图ID 和权限ID数组
|
||||
* @return ResultDomain<PermissionVO> 设置结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> setViewPermissions(PermissionVO permissionVO);
|
||||
|
||||
/**
|
||||
* @description 获取视图的权限列表
|
||||
* @param permissionVO 视图
|
||||
* @return ResultDomain<PermissionVO> 查询结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<PermissionVO> getViewPermissionList(PermissionVO permissionVO);
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package org.xyzh.api.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
|
||||
/**
|
||||
* @description 访问控制列表视图对象
|
||||
* @filename AclVO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "访问控制列表视图对象")
|
||||
public class AclVO extends BaseVO {
|
||||
// TbSysAclDTO对应字段
|
||||
@Schema(description = "权限ID")
|
||||
private String aclId;
|
||||
|
||||
@Schema(description = "对象类型:article/file/course/...")
|
||||
private String objectType;
|
||||
|
||||
@Schema(description = "对象ID")
|
||||
private String objectId;
|
||||
|
||||
@Schema(description = "主体类型:user/dept/role")
|
||||
private String principalType;
|
||||
|
||||
@Schema(description = "主体ID")
|
||||
private String principalId;
|
||||
|
||||
@Schema(description = "当主体为role且限定到某部门时的部门ID(支持某部门的某角色)")
|
||||
private String principalDeptId;
|
||||
|
||||
@Schema(description = "权限位:1读 2写 4执行")
|
||||
private Integer permission;
|
||||
|
||||
@Schema(description = "允许或显式拒绝", defaultValue = "true")
|
||||
private Boolean allow = true;
|
||||
|
||||
@Schema(description = "是否包含子级(对dept/role生效)", defaultValue = "false")
|
||||
private Boolean includeDescendants = false;
|
||||
|
||||
// TbSysAclPolicyDTO对应字段
|
||||
@Schema(description = "策略ID")
|
||||
private String policyId;
|
||||
|
||||
@Schema(description = "策略名称")
|
||||
private String policyName;
|
||||
|
||||
@Schema(description = "对象类型:article/file/course/..")
|
||||
private String policyObjectType;
|
||||
|
||||
@Schema(description = "编辑层级规则:parent_only/parent_or_same_admin/owner_only/none")
|
||||
private String editHierarchyRule;
|
||||
|
||||
@Schema(description = "可见层级规则 children_all/children_specified/none")
|
||||
private String viewHierarchyRule;
|
||||
|
||||
@Schema(description = "默认权限(无显式ACL时应用)", defaultValue = "0")
|
||||
private Integer defaultPermission = 0;
|
||||
|
||||
@Schema(description = "默认是否允许", defaultValue = "true")
|
||||
private boolean defaultAllow = true;
|
||||
|
||||
@Schema(description = "是否默认应用到子级", defaultValue = "true")
|
||||
private boolean applyToChildren = true;
|
||||
}
|
||||
@@ -0,0 +1,221 @@
|
||||
package org.xyzh.api.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
|
||||
import java.util.List;
|
||||
import org.xyzh.common.dto.sys.TbSysModuleDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysPermissionDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysViewDTO;
|
||||
|
||||
/**
|
||||
* @description 权限视图对象
|
||||
* @filename PermissionVO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "权限视图对象")
|
||||
public class PermissionVO extends BaseVO {
|
||||
// TbSysDeptDTO对应字段
|
||||
@Schema(description = "部门ID")
|
||||
private String deptId;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "父级部门ID")
|
||||
private String deptParentId;
|
||||
|
||||
@Schema(description = "部门描述")
|
||||
private String deptDescription;
|
||||
|
||||
// TbSysRoleDTO对应字段
|
||||
@Schema(description = "角色ID")
|
||||
private String roleId;
|
||||
|
||||
@Schema(description = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
@Schema(description = "角色描述")
|
||||
private String roleDescription;
|
||||
|
||||
@Schema(description = "角色作用域")
|
||||
private String roleScope;
|
||||
|
||||
@Schema(description = "所属部门ID")
|
||||
private String roleOwnerDeptId;
|
||||
|
||||
@Schema(description = "角色状态")
|
||||
private boolean roleStatus;
|
||||
|
||||
// TbSysModuleDTO对应字段
|
||||
@Schema(description = "模块ID")
|
||||
private String moduleId;
|
||||
|
||||
@Schema(description = "模块名称")
|
||||
private String moduleName;
|
||||
|
||||
@Schema(description = "模块描述")
|
||||
private String moduleDescription;
|
||||
|
||||
// TbSysPermissionDTO对应字段
|
||||
@Schema(description = "权限ID")
|
||||
private String permissionId;
|
||||
|
||||
@Schema(description = "权限名称")
|
||||
private String permissionName;
|
||||
|
||||
@Schema(description = "权限代码")
|
||||
private String permissionCode;
|
||||
|
||||
@Schema(description = "权限描述")
|
||||
private String permissionDescription;
|
||||
|
||||
@Schema(description = "权限状态")
|
||||
private String permissionStatus;
|
||||
|
||||
// TbSysViewDTO对应字段
|
||||
@Schema(description = "视图ID")
|
||||
private String viewId;
|
||||
|
||||
@Schema(description = "视图名称")
|
||||
private String viewName;
|
||||
|
||||
@Schema(description = "父视图ID")
|
||||
private String viewParentId;
|
||||
|
||||
@Schema(description = "URL")
|
||||
private String viewUrl;
|
||||
|
||||
@Schema(description = "组件")
|
||||
private String viewComponent;
|
||||
|
||||
@Schema(description = "图标")
|
||||
private String viewIcon;
|
||||
|
||||
@Schema(description = "类型")
|
||||
private Integer viewType;
|
||||
|
||||
@Schema(description = "布局")
|
||||
private String viewLayout;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer viewOrderNum;
|
||||
|
||||
@Schema(description = "视图描述")
|
||||
private String viewDescription;
|
||||
|
||||
// 角色权限数组
|
||||
@Schema(description = "用户视图权限列表")
|
||||
private List<String> permissionIdList;
|
||||
|
||||
public static TbSysModuleDTO toModuleDTO(PermissionVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
TbSysModuleDTO dto = new TbSysModuleDTO();
|
||||
dto.setModuleId(vo.getModuleId());
|
||||
dto.setName(vo.getModuleName());
|
||||
dto.setDescription(vo.getModuleDescription());
|
||||
dto.setOptsn(vo.getOptsn());
|
||||
dto.setCreator(vo.getCreator());
|
||||
dto.setUpdater(vo.getUpdater());
|
||||
dto.setDeptPath(vo.getDeptPath());
|
||||
dto.setRemark(vo.getRemark());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
dto.setDeleteTime(vo.getDeleteTime());
|
||||
dto.setDeleted(vo.getDeleted());
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static TbSysPermissionDTO toPermissionDTO(PermissionVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
TbSysPermissionDTO dto = new TbSysPermissionDTO();
|
||||
dto.setPermissionId(vo.getPermissionId());
|
||||
dto.setModuleId(vo.getModuleId());
|
||||
dto.setCode(vo.getPermissionCode());
|
||||
dto.setName(vo.getPermissionName());
|
||||
dto.setDescription(vo.getPermissionDescription());
|
||||
dto.setOptsn(vo.getOptsn());
|
||||
dto.setCreator(vo.getCreator());
|
||||
dto.setUpdater(vo.getUpdater());
|
||||
dto.setDeptPath(vo.getDeptPath());
|
||||
dto.setRemark(vo.getRemark());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
dto.setDeleteTime(vo.getDeleteTime());
|
||||
dto.setDeleted(vo.getDeleted());
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static TbSysViewDTO toViewDTO(PermissionVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
TbSysViewDTO dto = new TbSysViewDTO();
|
||||
dto.setViewId(vo.getViewId());
|
||||
dto.setName(vo.getViewName());
|
||||
dto.setParentId(vo.getViewParentId());
|
||||
dto.setUrl(vo.getViewUrl());
|
||||
dto.setComponent(vo.getViewComponent());
|
||||
dto.setIcon(vo.getViewIcon());
|
||||
dto.setType(vo.getViewType());
|
||||
dto.setLayout(vo.getViewLayout());
|
||||
dto.setOrderNum(vo.getViewOrderNum());
|
||||
dto.setDescription(vo.getViewDescription());
|
||||
dto.setOptsn(vo.getOptsn());
|
||||
dto.setCreator(vo.getCreator());
|
||||
dto.setUpdater(vo.getUpdater());
|
||||
dto.setDeptPath(vo.getDeptPath());
|
||||
dto.setRemark(vo.getRemark());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
dto.setDeleteTime(vo.getDeleteTime());
|
||||
dto.setDeleted(vo.getDeleted());
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static PermissionVO fromViewDTO(TbSysViewDTO dto) {
|
||||
if (dto == null) {
|
||||
return null;
|
||||
}
|
||||
PermissionVO vo = new PermissionVO();
|
||||
vo.setViewId(dto.getViewId());
|
||||
vo.setViewName(dto.getName());
|
||||
vo.setViewParentId(dto.getParentId());
|
||||
vo.setViewUrl(dto.getUrl());
|
||||
vo.setViewComponent(dto.getComponent());
|
||||
vo.setViewIcon(dto.getIcon());
|
||||
vo.setViewType(dto.getType());
|
||||
vo.setViewLayout(dto.getLayout());
|
||||
vo.setViewOrderNum(dto.getOrderNum());
|
||||
vo.setViewDescription(dto.getDescription());
|
||||
vo.setOptsn(dto.getOptsn());
|
||||
vo.setCreator(dto.getCreator());
|
||||
vo.setUpdater(dto.getUpdater());
|
||||
vo.setDeptPath(dto.getDeptPath());
|
||||
vo.setRemark(dto.getRemark());
|
||||
vo.setCreateTime(dto.getCreateTime());
|
||||
vo.setUpdateTime(dto.getUpdateTime());
|
||||
vo.setDeleteTime(dto.getDeleteTime());
|
||||
vo.setDeleted(dto.getDeleted());
|
||||
return vo;
|
||||
}
|
||||
|
||||
public static java.util.List<PermissionVO> fromViewDTOList(java.util.List<TbSysViewDTO> dtoList) {
|
||||
if (dtoList == null || dtoList.isEmpty()) {
|
||||
return java.util.Collections.emptyList();
|
||||
}
|
||||
return dtoList.stream()
|
||||
.map(PermissionVO::fromViewDTO)
|
||||
.toList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,100 @@
|
||||
package org.xyzh.api.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import org.xyzh.common.dto.sys.TbSysConfigDTO;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
|
||||
/**
|
||||
* @description 系统配置视图对象
|
||||
* @filename SysConfigVO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统配置视图对象")
|
||||
public class SysConfigVO extends BaseVO {
|
||||
|
||||
|
||||
@Schema(description = "配置ID")
|
||||
private String configId;
|
||||
|
||||
@Schema(description = "配置键")
|
||||
private String key;
|
||||
|
||||
@Schema(description = "配置名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "配置值")
|
||||
private String value;
|
||||
|
||||
@Schema(description = "数据类型(String, Integer, Boolean, Float, Double)")
|
||||
private String configType;
|
||||
|
||||
@Schema(description = "配置渲染类型(select, input, textarea, checkbox, radio, switch)")
|
||||
private String renderType;
|
||||
|
||||
@Schema(description = "配置描述")
|
||||
private String description;
|
||||
|
||||
@Schema(description = "正则表达式校验规则(JSON)")
|
||||
private JSONObject re;
|
||||
|
||||
@Schema(description = "可选项(JSON),render_type为select、checkbox、radio时使用")
|
||||
private JSONObject options;
|
||||
|
||||
@Schema(description = "配置组")
|
||||
private String group;
|
||||
|
||||
@Schema(description = "模块ID")
|
||||
private String moduleId;
|
||||
|
||||
@Schema(description = "模块名称")
|
||||
private String moduleName;
|
||||
|
||||
@Schema(description = "模块描述")
|
||||
private String moduleDescription;
|
||||
|
||||
@Schema(description = "配置顺序")
|
||||
private Integer orderNum;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
public static TbSysConfigDTO toDTO(SysConfigVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
TbSysConfigDTO dto = new TbSysConfigDTO();
|
||||
dto.setConfigId(vo.getConfigId());
|
||||
dto.setKey(vo.getKey());
|
||||
dto.setName(vo.getName());
|
||||
dto.setValue(vo.getValue());
|
||||
dto.setConfigType(vo.getConfigType());
|
||||
dto.setRenderType(vo.getRenderType());
|
||||
dto.setDescription(vo.getDescription());
|
||||
dto.setRe(vo.getRe());
|
||||
dto.setOptions(vo.getOptions());
|
||||
dto.setGroup(vo.getGroup());
|
||||
dto.setModuleId(vo.getModuleId());
|
||||
dto.setOrderNum(vo.getOrderNum());
|
||||
dto.setStatus(vo.getStatus());
|
||||
// 基础字段
|
||||
dto.setOptsn(vo.getOptsn());
|
||||
dto.setCreator(vo.getCreator());
|
||||
dto.setUpdater(vo.getUpdater());
|
||||
dto.setDeptPath(vo.getDeptPath());
|
||||
dto.setRemark(vo.getRemark());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
dto.setDeleteTime(vo.getDeleteTime());
|
||||
dto.setDeleted(vo.getDeleted());
|
||||
return dto;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
package org.xyzh.api.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
|
||||
import org.xyzh.common.dto.sys.TbSysUserDTO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @description 系统用户视图对象
|
||||
* @filename SysUserVO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统用户视图对象")
|
||||
public class SysUserVO extends BaseVO {
|
||||
|
||||
// TbSysUserDTO对应字段
|
||||
@Schema(description = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码(敏感信息,仅用于创建/修改)")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "手机")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "微信ID")
|
||||
private String wechatId;
|
||||
|
||||
@Schema(description = "用户状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "用户类型")
|
||||
private String userType;
|
||||
|
||||
// TbSysUserInfoDTO对应字段
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "姓")
|
||||
private String familyName;
|
||||
|
||||
@Schema(description = "名")
|
||||
private String givenName;
|
||||
|
||||
@Schema(description = "全名")
|
||||
private String fullName;
|
||||
|
||||
@Schema(description = "等级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "身份证号")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
// 关联信息
|
||||
@Schema(description = "用户部门角色列表")
|
||||
private List<UserDeptRoleVO> deptRoles;
|
||||
|
||||
@Schema(description = "用户角色权限列表")
|
||||
private List<PermissionVO> rolePermissions;
|
||||
|
||||
@Schema(description = "用户视图权限列表")
|
||||
private List<PermissionVO> viewPermissions;
|
||||
|
||||
public static TbSysUserDTO toDTO(SysUserVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
TbSysUserDTO dto = new TbSysUserDTO();
|
||||
dto.setUserId(vo.getUserId());
|
||||
dto.setUsername(vo.getUsername());
|
||||
dto.setPassword(vo.getPassword());
|
||||
dto.setEmail(vo.getEmail());
|
||||
dto.setPhone(vo.getPhone());
|
||||
dto.setWechatId(vo.getWechatId());
|
||||
dto.setStatus(vo.getStatus());
|
||||
dto.setUserType(vo.getUserType());
|
||||
dto.setOptsn(vo.getOptsn());
|
||||
dto.setCreator(vo.getCreator());
|
||||
dto.setUpdater(vo.getUpdater());
|
||||
dto.setDeptPath(vo.getDeptPath());
|
||||
dto.setRemark(vo.getRemark());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
dto.setDeleteTime(vo.getDeleteTime());
|
||||
dto.setDeleted(vo.getDeleted());
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static TbSysUserDTO toFilter(SysUserVO vo) {
|
||||
return toDTO(vo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,195 @@
|
||||
package org.xyzh.api.system.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
import org.xyzh.common.dto.sys.TbSysDeptDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysRoleDTO;
|
||||
import org.xyzh.common.dto.sys.TbSysDeptRoleDTO;
|
||||
|
||||
/**
|
||||
* @description 用户部门角色视图对象
|
||||
* @filename UserDeptRoleVO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "用户部门角色视图对象")
|
||||
public class UserDeptRoleVO extends BaseVO {
|
||||
|
||||
// TbSysUserDTO对应字段
|
||||
@Schema(description = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "邮箱")
|
||||
private String email;
|
||||
|
||||
@Schema(description = "手机")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "微信ID")
|
||||
private String wechatId;
|
||||
|
||||
@Schema(description = "用户状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "用户类型")
|
||||
private String userType;
|
||||
|
||||
// TbSysUserInfoDTO对应字段
|
||||
@Schema(description = "头像")
|
||||
private String avatar;
|
||||
|
||||
@Schema(description = "性别")
|
||||
private Integer gender;
|
||||
|
||||
@Schema(description = "姓")
|
||||
private String familyName;
|
||||
|
||||
@Schema(description = "名")
|
||||
private String givenName;
|
||||
|
||||
@Schema(description = "全名")
|
||||
private String fullName;
|
||||
|
||||
@Schema(description = "等级")
|
||||
private Integer level;
|
||||
|
||||
@Schema(description = "身份证号")
|
||||
private String idCard;
|
||||
|
||||
@Schema(description = "地址")
|
||||
private String address;
|
||||
|
||||
// TbSysDeptDTO对应字段
|
||||
@Schema(description = "部门ID")
|
||||
private String deptId;
|
||||
|
||||
@Schema(description = "部门名称")
|
||||
private String deptName;
|
||||
|
||||
@Schema(description = "父级部门ID")
|
||||
private String parentId;
|
||||
|
||||
@Schema(description = "部门描述")
|
||||
private String deptDescription;
|
||||
|
||||
// TbSysRoleDTO对应字段(SysRoleVO的字段)
|
||||
@Schema(description = "角色ID")
|
||||
private String roleId;
|
||||
|
||||
@Schema(description = "角色名称")
|
||||
private String roleName;
|
||||
|
||||
@Schema(description = "角色描述")
|
||||
private String roleDescription;
|
||||
|
||||
@Schema(description = "角色作用域")
|
||||
private String scope;
|
||||
|
||||
@Schema(description = "所属部门ID")
|
||||
private String ownerDeptId;
|
||||
|
||||
@Schema(description = "角色状态")
|
||||
private boolean roleStatus;
|
||||
|
||||
|
||||
public static TbSysDeptDTO toDeptDTO(UserDeptRoleVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
TbSysDeptDTO dto = new TbSysDeptDTO();
|
||||
dto.setDeptId(vo.getDeptId());
|
||||
dto.setName(vo.getDeptName());
|
||||
dto.setParentId(vo.getParentId());
|
||||
dto.setDescription(vo.getDeptDescription());
|
||||
dto.setOptsn(vo.getOptsn());
|
||||
dto.setCreator(vo.getCreator());
|
||||
dto.setUpdater(vo.getUpdater());
|
||||
dto.setDeptPath(vo.getDeptPath());
|
||||
dto.setRemark(vo.getRemark());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
dto.setDeleteTime(vo.getDeleteTime());
|
||||
dto.setDeleted(vo.getDeleted());
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static TbSysRoleDTO toRoleDTO(UserDeptRoleVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
TbSysRoleDTO dto = new TbSysRoleDTO();
|
||||
dto.setRoleId(vo.getRoleId());
|
||||
dto.setName(vo.getRoleName());
|
||||
dto.setDescription(vo.getRoleDescription());
|
||||
dto.setScope(vo.getScope());
|
||||
dto.setOwnerDeptId(vo.getOwnerDeptId());
|
||||
dto.setStatus(vo.isRoleStatus());
|
||||
dto.setOptsn(vo.getOptsn());
|
||||
dto.setCreator(vo.getCreator());
|
||||
dto.setUpdater(vo.getUpdater());
|
||||
dto.setDeptPath(vo.getDeptPath());
|
||||
dto.setRemark(vo.getRemark());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
dto.setDeleteTime(vo.getDeleteTime());
|
||||
dto.setDeleted(vo.getDeleted());
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static TbSysDeptRoleDTO toDeptRoleDTO(UserDeptRoleVO vo) {
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
TbSysDeptRoleDTO dto = new TbSysDeptRoleDTO();
|
||||
dto.setDeptId(vo.getDeptId());
|
||||
dto.setRoleId(vo.getRoleId());
|
||||
dto.setOptsn(vo.getOptsn());
|
||||
dto.setCreator(vo.getCreator());
|
||||
dto.setUpdater(vo.getUpdater());
|
||||
dto.setDeptPath(vo.getDeptPath());
|
||||
dto.setRemark(vo.getRemark());
|
||||
dto.setCreateTime(vo.getCreateTime());
|
||||
dto.setUpdateTime(vo.getUpdateTime());
|
||||
dto.setDeleteTime(vo.getDeleteTime());
|
||||
dto.setDeleted(vo.getDeleted());
|
||||
return dto;
|
||||
}
|
||||
|
||||
public static UserDeptRoleVO fromPermission(PermissionVO permissionVO) {
|
||||
if (permissionVO == null) {
|
||||
return null;
|
||||
}
|
||||
UserDeptRoleVO vo = new UserDeptRoleVO();
|
||||
vo.setDeptId(permissionVO.getDeptId());
|
||||
vo.setDeptName(permissionVO.getDeptName());
|
||||
vo.setParentId(permissionVO.getDeptParentId());
|
||||
vo.setDeptDescription(permissionVO.getDeptDescription());
|
||||
vo.setRoleId(permissionVO.getRoleId());
|
||||
vo.setRoleName(permissionVO.getRoleName());
|
||||
vo.setRoleDescription(permissionVO.getRoleDescription());
|
||||
vo.setScope(permissionVO.getRoleScope());
|
||||
vo.setOwnerDeptId(permissionVO.getRoleOwnerDeptId());
|
||||
vo.setRoleStatus(permissionVO.isRoleStatus());
|
||||
vo.setOptsn(permissionVO.getOptsn());
|
||||
vo.setCreator(permissionVO.getCreator());
|
||||
vo.setUpdater(permissionVO.getUpdater());
|
||||
vo.setDeptPath(permissionVO.getDeptPath());
|
||||
vo.setRemark(permissionVO.getRemark());
|
||||
vo.setCreateTime(permissionVO.getCreateTime());
|
||||
vo.setUpdateTime(permissionVO.getUpdateTime());
|
||||
vo.setDeleteTime(permissionVO.getDeleteTime());
|
||||
vo.setDeleted(permissionVO.getDeleted());
|
||||
return vo;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user