temp
This commit is contained in:
41
urbanLifelineServ/apis/api-all/pom.xml
Normal file
41
urbanLifelineServ/apis/api-all/pom.xml
Normal file
@@ -0,0 +1,41 @@
|
||||
<?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-all</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>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-auth</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-file</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-message</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-system</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
22
urbanLifelineServ/apis/api-auth/pom.xml
Normal file
22
urbanLifelineServ/apis/api-auth/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-auth</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,74 @@
|
||||
package org.xyzh.api.auth.service;
|
||||
|
||||
import org.xyzh.common.core.domain.LoginDomain;
|
||||
import org.xyzh.common.core.domain.LoginParam;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @description 认证服务接口
|
||||
* @filename AuthService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface AuthService {
|
||||
|
||||
/**
|
||||
* @description 登录
|
||||
* @param LoginParam loginParam 登录参数
|
||||
* @param HttpServletRequest request 请求
|
||||
* @return ResultDomain<LoginDomain> 登录结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> login(LoginParam loginParam, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* @description 刷新token
|
||||
* @param HttpServletRequest request 请求
|
||||
* @return ResultDomain<LoginDomain> 刷新token结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> refreshToken(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* @description 登出
|
||||
* @param HttpServletRequest request 请求
|
||||
* @return ResultDomain<LoginDomain> 登出结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> logout(HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* @description 根据验证码类型获取验证码
|
||||
* @param LoginParam loginParam 登录参数
|
||||
* @return ResultDomain<LoginDomain> 获取验证码结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> getCaptcha(LoginParam loginParam);
|
||||
|
||||
/**
|
||||
* @description 根据 token 获取登录信息,供其他服务调用以判定用户登录状态
|
||||
* @param token 鉴权 token(例如 JWT 或会话 token)
|
||||
* @return ResultDomain<LoginDomain> 登录信息,若 token 无效或未登录则在 ResultDomain 中返回相应状态/错误
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<LoginDomain> getLoginByToken(String token);
|
||||
|
||||
/**
|
||||
* @description 简单校验 token 是否有效(用于快速判断是否已登录)
|
||||
* @param token 鉴权 token
|
||||
* @return ResultDomain<Boolean> true 表示有效/已登录,false 表示无效/未登录
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<Boolean> isTokenValid(String token);
|
||||
|
||||
|
||||
}
|
||||
22
urbanLifelineServ/apis/api-file/pom.xml
Normal file
22
urbanLifelineServ/apis/api-file/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-file</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,49 @@
|
||||
package org.xyzh.api.file.dto;
|
||||
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @description 系统文件DTO
|
||||
* @filename TbSysFileDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统文件DTO")
|
||||
public class TbSysFileDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "文件ID (主键)")
|
||||
private String fileId;
|
||||
|
||||
@Schema(description = "文件名")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "文件路径")
|
||||
private String path;
|
||||
|
||||
@Schema(description = "文件大小(字节)")
|
||||
private Long size;
|
||||
|
||||
@Schema(description = "文件类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "存储类型")
|
||||
private String storageType;
|
||||
|
||||
@Schema(description = "MIME 类型")
|
||||
private String mimeType;
|
||||
|
||||
@Schema(description = "文件访问 URL")
|
||||
private String url;
|
||||
|
||||
@Schema(description = "文件状态")
|
||||
private String status;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
package org.xyzh.api.file.service;
|
||||
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.xyzh.api.file.dto.TbSysFileDTO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
|
||||
/**
|
||||
* @description 文件服务接口
|
||||
* @filename FileService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
public interface FileService {
|
||||
|
||||
/**
|
||||
* @description 上传文件
|
||||
* @param file 文件对象
|
||||
* @param module 所属模块
|
||||
* @param businessId 业务ID
|
||||
* @return ResultDomain<TbSysFile> 上传结果,包含文件信息
|
||||
* @author yslg
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> uploadFile(MultipartFile file, String module, String businessId);
|
||||
|
||||
/**
|
||||
* @description 批量上传文件
|
||||
* @param files 文件对象列表
|
||||
* @param module 所属模块
|
||||
* @param businessId 业务ID
|
||||
* @param uploader 上传者用户ID(可选)
|
||||
* @return ResultDomain<TbSysFile> 上传结果,包含文件信息列表
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> batchUploadFiles(MultipartFile[] files, String module, String businessId, String uploader);
|
||||
|
||||
/**
|
||||
* @description 删除文件
|
||||
* @param fileId 文件ID
|
||||
* @return ResultDomain<String> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<Boolean> deleteFile(String fileId);
|
||||
|
||||
/**
|
||||
* @description 批量删除文件(逻辑删除)
|
||||
* @param fileIds 文件ID列表
|
||||
* @return ResultDomain<TbSysFileDTO> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-10-16
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> batchDeleteFiles(String[] fileIds);
|
||||
|
||||
/**
|
||||
* @description 下载文件
|
||||
* @param fileId 文件ID
|
||||
* @return ResultDomain<byte[]> 文件字节数组
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<byte[]> downloadFile(String fileId);
|
||||
|
||||
/**
|
||||
* @description 根据文件ID查询文件信息
|
||||
* @param fileId 文件ID
|
||||
* @return ResultDomain<TbSysFile> 文件信息
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> getFileById(String fileId);
|
||||
|
||||
/**
|
||||
* @description 保存临时文件
|
||||
* @param file 文件对象
|
||||
* @param module 所属模块
|
||||
* @param businessId 业务ID
|
||||
* @return ResultDomain<TbSysFileDTO> 保存结果
|
||||
* @author yslg
|
||||
* @since 2025-11-03
|
||||
*/
|
||||
ResultDomain<TbSysFileDTO> saveTempFile(MultipartFile file, String module, String businessId);
|
||||
|
||||
}
|
||||
22
urbanLifelineServ/apis/api-log/pom.xml
Normal file
22
urbanLifelineServ/apis/api-log/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-log</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,51 @@
|
||||
package org.xyzh.api.log.dto;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
/**
|
||||
* @description 系统日志DTO
|
||||
* @filename TbSysLogDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统日志DTO")
|
||||
public class TbSysLogDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "日志ID")
|
||||
private String logId;
|
||||
|
||||
@Schema(description = "日志类型")
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "日志级别")
|
||||
private String level;
|
||||
|
||||
@Schema(description = "模块")
|
||||
private String module;
|
||||
|
||||
@Schema(description = "IP地址")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(description = "IP来源")
|
||||
private String ip_source;
|
||||
|
||||
@Schema(description = "浏览器")
|
||||
private String browser;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
private String os;
|
||||
|
||||
@Schema(description = "日志消息")
|
||||
private String message;
|
||||
|
||||
@Schema(description = "日志数据")
|
||||
private JSONObject data;
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package org.xyzh.api.log.dto;
|
||||
|
||||
import java.util.Date;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
/**
|
||||
* @description 系统登录日志DTO
|
||||
* @filename TbSysLoginLogDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "系统登录日志DTO")
|
||||
public class TbSysLoginLogDTO extends BaseDTO {
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "用户名")
|
||||
private String username;
|
||||
|
||||
@Schema(description = "IP地址")
|
||||
private String ipAddress;
|
||||
|
||||
@Schema(description = "IP来源")
|
||||
private String ipSource;
|
||||
|
||||
@Schema(description = "浏览器")
|
||||
private String browser;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
private String os;
|
||||
|
||||
@Schema(description = "密码")
|
||||
private String password;
|
||||
|
||||
@Schema(description = "登录时间")
|
||||
@JSONField(format = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date loginTime;
|
||||
|
||||
@Schema(description = "状态")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "错误次数")
|
||||
private Integer errorCount;
|
||||
|
||||
@Schema(description = "消息")
|
||||
private String message;
|
||||
}
|
||||
22
urbanLifelineServ/apis/api-message/pom.xml
Normal file
22
urbanLifelineServ/apis/api-message/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-message</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,43 @@
|
||||
package org.xyzh.api.message.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @description 消息渠道配置DTO
|
||||
* @filename TbMessageChannelDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "消息渠道配置DTO")
|
||||
public class TbMessageChannelDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "渠道ID")
|
||||
private String channelId;
|
||||
|
||||
@Schema(description = "渠道编码:app/sms/email/wechat/dingtalk等")
|
||||
private String channelCode;
|
||||
|
||||
@Schema(description = "渠道名称")
|
||||
private String channelName;
|
||||
|
||||
@Schema(description = "渠道描述")
|
||||
private String channelDesc;
|
||||
|
||||
@Schema(description = "渠道配置(JSON格式)")
|
||||
private String config;
|
||||
|
||||
@Schema(description = "渠道状态:enabled-启用/disabled-禁用/maintenance-维护中")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "优先级(数字越大优先级越高)")
|
||||
private Integer priority;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
package org.xyzh.api.message.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @description 消息DTO
|
||||
* @filename TbMessageDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-04
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "消息DTO")
|
||||
public class TbMessageDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "消息ID")
|
||||
private String messageId;
|
||||
|
||||
|
||||
@Schema(description = "消息标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "消息内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "消息类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "消息状态")
|
||||
private String status;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.xyzh.api.message.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
/**
|
||||
* @description 消息发送范围DTO
|
||||
* @filename TbMessageRangeDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "消息发送范围DTO")
|
||||
public class TbMessageRangeDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "消息ID")
|
||||
private String messageId;
|
||||
|
||||
@Schema(description = "目标类型:user-指定用户/dept-部门/role-角色/all-全员")
|
||||
private String targetType;
|
||||
|
||||
@Schema(description = "目标ID(用户、部门、角色ID等,all类型时为空)")
|
||||
private String targetId;
|
||||
|
||||
@Schema(description = "发送渠道:app/sms/email/wechat/dingtalk等")
|
||||
private String channel;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package org.xyzh.api.message.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.dto.BaseDTO;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
import java.time.ZonedDateTime;
|
||||
|
||||
/**
|
||||
* @description 用户消息接收记录DTO
|
||||
* @filename TbMessageReceiverDTO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "用户消息接收记录DTO")
|
||||
public class TbMessageReceiverDTO extends BaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "消息ID")
|
||||
private String messageId;
|
||||
|
||||
@Schema(description = "用户ID")
|
||||
private String userId;
|
||||
|
||||
@Schema(description = "接收渠道:app/sms/email/wechat/dingtalk等")
|
||||
private String channel;
|
||||
|
||||
@Schema(description = "消息状态:unread-未读/read-已读/handled-已处理/deleted-已删除")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "阅读时间")
|
||||
private ZonedDateTime readTime;
|
||||
|
||||
@Schema(description = "处理时间")
|
||||
private ZonedDateTime handleTime;
|
||||
}
|
||||
@@ -0,0 +1,135 @@
|
||||
package org.xyzh.api.message.service;
|
||||
|
||||
import org.xyzh.api.message.dto.TbMessageDTO;
|
||||
import org.xyzh.api.message.vo.MessageVO;
|
||||
import org.xyzh.common.core.domain.ResultDomain;
|
||||
import org.xyzh.common.core.page.PageParam;
|
||||
|
||||
|
||||
/**
|
||||
* @description 消息服务接口
|
||||
* @filename MessageService.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
public interface MessageService {
|
||||
|
||||
//================= 用户查看消息列表 =================
|
||||
|
||||
/**
|
||||
* @description 获取我的消息列表
|
||||
* @param userId 用户ID
|
||||
* @return ResultDomain<TbMessageDTO> 消息列表
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> getMyMessageList(TbMessageDTO filter);
|
||||
|
||||
/**
|
||||
* @description 获取我的消息分页列表
|
||||
* @param TbMessageDTO filter 消息过滤条件
|
||||
* @param PageParam pageParam 分页参数
|
||||
* @return ResultDomain<TbMessageDTO> 消息分页列表
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> getMyMessagePage(TbMessageDTO filter, PageParam pageParam);
|
||||
|
||||
/**
|
||||
* @description 获取我的消息详情
|
||||
* @param messageId 消息ID
|
||||
* @return ResultDomain<TbMessageDTO> 消息详情
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> getMyMessageDetail(String messageId);
|
||||
|
||||
// ================= 用户处理消息 =================
|
||||
/**
|
||||
* @description 用户处理消息
|
||||
* @param messageId 消息ID
|
||||
* @param status 消息状态
|
||||
* @return ResultDomain<TbMessageDTO> 消息处理结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> handleMessage(String messageId, String status);
|
||||
|
||||
// ================= 管理员查看消息列表 =================
|
||||
/**
|
||||
* @description 获取消息列表
|
||||
* @param TbMessageDTO filter 消息过滤条件
|
||||
* @return ResultDomain<TbMessageDTO> 消息列表
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> getMessageList(TbMessageDTO filter);
|
||||
|
||||
/**
|
||||
* @description 获取消息分页列表
|
||||
* @param TbMessageDTO filter 消息过滤条件
|
||||
* @param PageParam pageParam 分页参数
|
||||
* @return ResultDomain<TbMessageDTO> 消息分页列表
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> getMessagePage(TbMessageDTO filter, PageParam pageParam);
|
||||
|
||||
|
||||
/**
|
||||
* @description 获取消息详情
|
||||
* @param messageId 消息ID
|
||||
* @return ResultDomain<TbMessageDTO> 消息详情
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<MessageVO> getMessageDetail(String messageId);
|
||||
|
||||
// ================= 管理员处理消息 =================
|
||||
|
||||
/**
|
||||
* @description 创建消息
|
||||
* @param MessageVO messageVO 消息VO
|
||||
* @return ResultDomain<TbMessageDTO> 创建结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> createMessage(MessageVO messageVO);
|
||||
|
||||
/**
|
||||
* @description 更新消息
|
||||
* @param MessageVO messageVO 消息VO
|
||||
* @return ResultDomain<TbMessageDTO> 更新结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> updateMessage(MessageVO messageVO);
|
||||
|
||||
/**
|
||||
* @description 删除消息
|
||||
* @param messageId 消息ID
|
||||
* @return ResultDomain<TbMessageDTO> 删除结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<Boolean> deleteMessage(String messageId);
|
||||
|
||||
/**
|
||||
* @description 发送消息
|
||||
* @param MessageVO messageVO 消息VO
|
||||
* @return ResultDomain<MessageVO> 发送结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<MessageVO> sendMessage(MessageVO messageVO);
|
||||
|
||||
/**
|
||||
* @description 撤回消息
|
||||
* @param messageId 消息ID
|
||||
* @return ResultDomain<TbMessageDTO> 撤回结果
|
||||
* @author yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
ResultDomain<TbMessageDTO> withdrawMessage(String messageId);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package org.xyzh.api.message.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
|
||||
/**
|
||||
* @description 消息发送范围和渠道VO(Range和Channel的平铺组合)
|
||||
* @filename MessageRangeChannelVO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "消息发送范围和渠道VO")
|
||||
public class MessageRangeChannelVO extends BaseVO {
|
||||
|
||||
// ========== Range相关字段 ==========
|
||||
@Schema(description = "消息ID")
|
||||
private String messageId;
|
||||
|
||||
@Schema(description = "目标类型:user-指定用户/dept-部门/role-角色/all-全员")
|
||||
private String targetType;
|
||||
|
||||
@Schema(description = "目标ID(用户、部门、角色ID等,all类型时为空)")
|
||||
private String targetId;
|
||||
|
||||
@Schema(description = "目标名称(用户名、部门名、角色名等,用于前端展示)")
|
||||
private String targetName;
|
||||
|
||||
// ========== Channel相关字段 ==========
|
||||
@Schema(description = "渠道编码:app/sms/email/wechat/dingtalk等")
|
||||
private String channelCode;
|
||||
|
||||
@Schema(description = "渠道名称")
|
||||
private String channelName;
|
||||
|
||||
@Schema(description = "渠道描述")
|
||||
private String channelDesc;
|
||||
|
||||
@Schema(description = "渠道状态:enabled-启用/disabled-禁用/maintenance-维护中")
|
||||
private String channelStatus;
|
||||
|
||||
@Schema(description = "渠道优先级(数字越大优先级越高)")
|
||||
private Integer channelPriority;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package org.xyzh.api.message.vo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.xyzh.api.message.dto.TbMessageReceiverDTO;
|
||||
import org.xyzh.common.vo.BaseVO;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* @description 消息VO(包含消息详情和发送范围)
|
||||
* @filename MessageVO.java
|
||||
* @author yslg
|
||||
* @copyright yslg
|
||||
* @since 2025-11-05
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "消息VO")
|
||||
public class MessageVO extends BaseVO {
|
||||
|
||||
@Schema(description = "消息ID")
|
||||
private String messageId;
|
||||
|
||||
@Schema(description = "消息标题")
|
||||
private String title;
|
||||
|
||||
@Schema(description = "消息内容")
|
||||
private String content;
|
||||
|
||||
@Schema(description = "消息类型")
|
||||
private String type;
|
||||
|
||||
@Schema(description = "消息状态")
|
||||
private String status;
|
||||
|
||||
@Schema(description = "消息发送范围列表")
|
||||
private List<MessageRangeChannelVO> messageRanges;
|
||||
|
||||
@Schema(description = "消息接收记录列表(管理员查看时使用)")
|
||||
private List<TbMessageReceiverDTO> messageReceivers;
|
||||
}
|
||||
238
urbanLifelineServ/apis/api-message/消息系统设计说明.md
Normal file
238
urbanLifelineServ/apis/api-message/消息系统设计说明.md
Normal file
@@ -0,0 +1,238 @@
|
||||
# 消息系统设计说明
|
||||
|
||||
## 📊 数据表结构
|
||||
|
||||
### 1. tb_message - 消息主表
|
||||
存储消息的基本信息
|
||||
|
||||
**主要字段:**
|
||||
- `message_id` - 消息ID(主键)
|
||||
- `title` - 消息标题
|
||||
- `content` - 消息内容
|
||||
- `type` - 消息类型
|
||||
- `status` - 消息状态
|
||||
|
||||
### 2. tb_message_range - 消息发送范围定义表
|
||||
定义消息要发送给哪些对象,通过什么渠道
|
||||
|
||||
**主要字段:**
|
||||
- `message_id` - 消息ID
|
||||
- `target_type` - 目标类型(user/dept/role/all)
|
||||
- `target_id` - 目标ID(用户、部门、角色ID等)
|
||||
- `channel` - 发送渠道(app/sms/email/wechat等)
|
||||
- **唯一约束:** (message_id, target_type, target_id, channel)
|
||||
|
||||
**使用示例:**
|
||||
- 发送给部门001,通过app:`{target_type: 'dept', target_id: 'D001', channel: 'app'}`
|
||||
- 发送给部门001,通过sms:`{target_type: 'dept', target_id: 'D001', channel: 'sms'}`
|
||||
- 发送给全员,通过app:`{target_type: 'all', target_id: null, channel: 'app'}`
|
||||
|
||||
### 3. tb_message_receiver - 用户消息接收记录表
|
||||
记录每个用户实际收到的消息及处理状态
|
||||
|
||||
**主要字段:**
|
||||
- `message_id` - 消息ID
|
||||
- `user_id` - 用户ID
|
||||
- `channel` - 接收渠道
|
||||
- `status` - 消息状态(unread/read/handled/deleted)
|
||||
- `read_time` - 阅读时间
|
||||
- `handle_time` - 处理时间
|
||||
- **唯一约束:** (message_id, user_id, channel)
|
||||
|
||||
**索引:**
|
||||
- `idx_message_user_user_status` - 快速查询用户消息列表
|
||||
- `idx_message_user_message` - 快速查询消息的接收情况
|
||||
|
||||
### 4. tb_message_channel - 消息渠道配置表
|
||||
管理各种消息发送渠道的配置
|
||||
|
||||
**主要字段:**
|
||||
- `channel_id` - 渠道ID(主键)
|
||||
- `channel_code` - 渠道编码(app/sms/email/wechat/dingtalk)
|
||||
- `channel_name` - 渠道名称
|
||||
- `config` - 渠道配置(JSON格式,存储API密钥等)
|
||||
- `status` - 渠道状态(enabled/disabled/maintenance)
|
||||
- `priority` - 优先级
|
||||
|
||||
**预置渠道:**
|
||||
- app - 应用内消息(已启用)
|
||||
- sms - 短信通知(已禁用)
|
||||
- email - 邮件通知(已禁用)
|
||||
- wechat - 微信通知(已禁用)
|
||||
- dingtalk - 钉钉通知(已禁用)
|
||||
|
||||
## 📦 DTO/VO 结构
|
||||
|
||||
### TbMessageDTO
|
||||
消息基本信息DTO
|
||||
|
||||
**字段:**
|
||||
- messageId
|
||||
- title
|
||||
- content
|
||||
- type
|
||||
- status
|
||||
|
||||
### TbMessageRangeDTO
|
||||
消息发送范围DTO
|
||||
|
||||
**字段:**
|
||||
- messageId
|
||||
- targetType - 目标类型
|
||||
- targetId - 目标ID
|
||||
- channel - 发送渠道
|
||||
|
||||
### TbMessageReceiverDTO
|
||||
用户消息接收记录DTO
|
||||
|
||||
**字段:**
|
||||
- messageId
|
||||
- userId
|
||||
- channel
|
||||
- status
|
||||
- readTime
|
||||
- handleTime
|
||||
|
||||
### TbMessageChannelDTO
|
||||
消息渠道配置DTO
|
||||
|
||||
**字段:**
|
||||
- channelId
|
||||
- channelCode
|
||||
- channelName
|
||||
- channelDesc
|
||||
- config
|
||||
- status
|
||||
- priority
|
||||
|
||||
### MessageVO
|
||||
消息视图对象(用于创建和查看消息)
|
||||
|
||||
**字段:**
|
||||
- messageId
|
||||
- title
|
||||
- content
|
||||
- type
|
||||
- status
|
||||
- createTime
|
||||
- creator
|
||||
- messageRanges - 消息发送范围列表
|
||||
- messageReceivers - 消息接收记录列表(管理员查看时使用)
|
||||
|
||||
## 🔄 业务流程
|
||||
|
||||
### 1. 创建并发送消息
|
||||
|
||||
```java
|
||||
// 创建消息
|
||||
MessageVO messageVO = new MessageVO();
|
||||
messageVO.setTitle("系统维护通知");
|
||||
messageVO.setContent("系统将于今晚22:00进行维护");
|
||||
messageVO.setType("notice");
|
||||
|
||||
// 定义发送范围(发给IT部门,通过app和email)
|
||||
List<TbMessageRangeDTO> ranges = new ArrayList<>();
|
||||
ranges.add(new TbMessageRangeDTO() {{
|
||||
setTargetType("dept");
|
||||
setTargetId("DEPT_IT");
|
||||
setChannel("app");
|
||||
}});
|
||||
ranges.add(new TbMessageRangeDTO() {{
|
||||
setTargetType("dept");
|
||||
setTargetId("DEPT_IT");
|
||||
setChannel("email");
|
||||
}});
|
||||
messageVO.setMessageRanges(ranges);
|
||||
|
||||
// 发送消息
|
||||
messageService.sendMessage(messageVO);
|
||||
```
|
||||
|
||||
**系统处理:**
|
||||
1. 在 `tb_message` 中创建消息记录
|
||||
2. 在 `tb_message_range` 中保存发送范围
|
||||
3. 根据 `target_type` 和 `target_id` 查询具体用户列表
|
||||
4. 在 `tb_message_receiver` 中为每个用户创建接收记录
|
||||
5. 根据 `channel` 调用相应的渠道服务发送消息
|
||||
|
||||
### 2. 用户查看消息列表
|
||||
|
||||
```sql
|
||||
-- 查询用户未读消息
|
||||
SELECT m.*, r.status, r.read_time, r.channel
|
||||
FROM message.tb_message m
|
||||
JOIN message.tb_message_receiver r ON m.message_id = r.message_id
|
||||
WHERE r.user_id = 'USER_001'
|
||||
AND r.status = 'unread'
|
||||
AND r.deleted = false
|
||||
ORDER BY m.create_time DESC;
|
||||
```
|
||||
|
||||
### 3. 用户处理消息
|
||||
|
||||
```java
|
||||
// 标记消息为已读
|
||||
messageService.handleMessage(messageId, "read");
|
||||
|
||||
// 标记消息为已处理
|
||||
messageService.handleMessage(messageId, "handled");
|
||||
```
|
||||
|
||||
**系统处理:**
|
||||
- 更新 `tb_message_receiver` 表的 `status` 字段
|
||||
- 根据状态更新 `read_time` 或 `handle_time`
|
||||
|
||||
### 4. 管理员查看消息统计
|
||||
|
||||
```sql
|
||||
-- 查询某条消息的发送统计
|
||||
SELECT
|
||||
r.channel,
|
||||
r.status,
|
||||
COUNT(*) as count
|
||||
FROM message.tb_message_receiver r
|
||||
WHERE r.message_id = 'MSG_001'
|
||||
AND r.deleted = false
|
||||
GROUP BY r.channel, r.status;
|
||||
```
|
||||
|
||||
## 🎯 设计优势
|
||||
|
||||
1. **职责分离**
|
||||
- `tb_message_range` - 定义发送规则
|
||||
- `tb_message_receiver` - 记录实际接收情况
|
||||
|
||||
2. **多渠道支持**
|
||||
- 同一消息可通过多个渠道发送
|
||||
- 渠道配置独立管理
|
||||
- 易于扩展新渠道
|
||||
|
||||
3. **灵活的目标定义**
|
||||
- 支持按用户、部门、角色、全员发送
|
||||
- 同一目标可使用不同渠道
|
||||
|
||||
4. **完整的状态跟踪**
|
||||
- 记录阅读时间、处理时间
|
||||
- 支持已读/未读/已处理/已删除等状态
|
||||
|
||||
5. **性能优化**
|
||||
- 合理的索引设计
|
||||
- 支持高效的用户消息查询
|
||||
|
||||
## 📝 注意事项
|
||||
|
||||
1. **数据一致性**
|
||||
- 发送消息时,确保 `tb_message_range` 和 `tb_message_receiver` 的事务一致性
|
||||
|
||||
2. **渠道验证**
|
||||
- 发送前检查 `tb_message_channel` 中渠道是否启用
|
||||
- 根据 `priority` 选择备用渠道
|
||||
|
||||
3. **性能考虑**
|
||||
- 全员消息(target_type='all')需要异步处理
|
||||
- 大量用户时分批创建 `tb_message_receiver` 记录
|
||||
|
||||
4. **软删除**
|
||||
- 所有表都使用软删除(deleted字段)
|
||||
- 查询时注意添加 `WHERE deleted = false` 条件
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
82
urbanLifelineServ/apis/pom.xml
Normal file
82
urbanLifelineServ/apis/pom.xml
Normal file
@@ -0,0 +1,82 @@
|
||||
<?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>urban-lifeline</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.xyzh</groupId>
|
||||
<artifactId>apis</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<packaging>pom</packaging>
|
||||
<modules>
|
||||
<module>api-all</module>
|
||||
<module>api-auth</module>
|
||||
<module>api-file</module>
|
||||
<module>api-message</module>
|
||||
<module>api-log</module>
|
||||
<module>api-system</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>21</maven.compiler.source>
|
||||
<maven.compiler.target>21</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-all</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-auth</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-file</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-message</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-system</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.apis</groupId>
|
||||
<artifactId>api-log</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.common</groupId>
|
||||
<artifactId>common-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.xyzh.common</groupId>
|
||||
<artifactId>common-dto</artifactId>
|
||||
<version>${urban-lifeline.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.dubbo</groupId>
|
||||
<artifactId>dubbo</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
Reference in New Issue
Block a user