清理与ztcloud中重复的代码,改为 jar 包方式引用 ztcloud
This commit is contained in:
@@ -3,19 +3,16 @@
|
||||
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">
|
||||
<parent>
|
||||
<artifactId>zt</artifactId>
|
||||
<artifactId>zt-dsc</artifactId>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modules>
|
||||
<module>zt-module-databus-api</module>
|
||||
<module>zt-module-databus-server</module>
|
||||
<module>zt-module-databus-server-app</module>
|
||||
<module>zt-module-databus-client</module>
|
||||
</modules>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>zt-module-databus</artifactId>
|
||||
<artifactId>zt-module-databus-dsc</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
<?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">
|
||||
<parent>
|
||||
<artifactId>zt-module-databus</artifactId>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>zt-module-databus-api</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
暴露给其它模块调用
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<artifactId>zt-common</artifactId>
|
||||
</dependency>
|
||||
<!-- Web 相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springdoc</groupId> <!-- 接口文档:使用最新版本的 Swagger 模型 -->
|
||||
<artifactId>springdoc-openapi-starter-webmvc-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- 参数校验 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- RPC 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-openfeign</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,90 +0,0 @@
|
||||
package com.zt.plat.module.databus.api.data;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 部门数据对象(DataBus)
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "部门数据")
|
||||
public class DatabusDeptData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
// ========== 基本信息 ==========
|
||||
|
||||
@Schema(description = "部门ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "100")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "部门编码", example = "DEPT_001")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "部门名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "技术部")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "部门简称", example = "技术")
|
||||
private String shortName;
|
||||
|
||||
@Schema(description = "父部门ID(顶级为0)", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "排序号", example = "1")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "状态:0-启用 1-禁用", requiredMode = Schema.RequiredMode.REQUIRED, example = "0")
|
||||
private Integer status;
|
||||
|
||||
// ========== 部门类型 ==========
|
||||
|
||||
@Schema(description = "部门类型:28-公司 26-部门", example = "26")
|
||||
private Integer deptType;
|
||||
|
||||
@Schema(description = "是否集团", example = "false")
|
||||
private Boolean isGroup;
|
||||
|
||||
@Schema(description = "是否公司", example = "false")
|
||||
private Boolean isCompany;
|
||||
|
||||
@Schema(description = "部门来源类型", example = "1")
|
||||
private Integer deptSource;
|
||||
|
||||
// ========== 联系信息 ==========
|
||||
|
||||
@Schema(description = "负责人ID", example = "1001")
|
||||
private Long leaderUserId;
|
||||
|
||||
@Schema(description = "负责人姓名", example = "张三")
|
||||
private String leaderUserName;
|
||||
|
||||
@Schema(description = "联系电话", example = "010-12345678")
|
||||
private String phone;
|
||||
|
||||
@Schema(description = "邮箱", example = "tech@example.com")
|
||||
private String email;
|
||||
|
||||
// ========== 多租户 ==========
|
||||
|
||||
@Schema(description = "租户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
// ========== 时间信息 ==========
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
package com.zt.plat.module.databus.api.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 岗位数据对象(DataBus)
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DatabusPostData implements Serializable {
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 岗位编码
|
||||
*/
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 岗位名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 状态(0正常 1停用)
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.zt.plat.module.databus.api.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与组织机构关联关系数据对象
|
||||
* <p>
|
||||
* 对应表:system_user_dept
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DatabusUserDeptData implements Serializable {
|
||||
|
||||
/**
|
||||
* 关联关系ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 部门ID
|
||||
*/
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 租户ID
|
||||
*/
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
package com.zt.plat.module.databus.api.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 用户与岗位关联关系数据对象
|
||||
* <p>
|
||||
* 对应表:system_user_post
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DatabusUserPostData implements Serializable {
|
||||
|
||||
/**
|
||||
* 关联关系ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 用户ID
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 岗位ID
|
||||
*/
|
||||
private Long postId;
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,48 +0,0 @@
|
||||
package com.zt.plat.module.databus.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 游标分页请求 DTO
|
||||
* <p>
|
||||
* 用于 Databus 全量同步时的断点续传
|
||||
* 使用 create_time + id 复合游标解决雪花ID非连续问题
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "游标分页请求")
|
||||
public class CursorPageReqDTO implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "游标时间(上一批最后一条数据的创建时间)", example = "2024-01-01T00:00:00")
|
||||
private LocalDateTime cursorTime;
|
||||
|
||||
@Schema(description = "游标ID(上一批最后一条数据的ID,用于同一时间戳内去重)", example = "1234567890")
|
||||
private Long cursorId;
|
||||
|
||||
@Schema(description = "批量大小", example = "100")
|
||||
private Integer batchSize;
|
||||
|
||||
@Schema(description = "租户ID(可选,用于多租户过滤)", example = "1")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 是否为首次查询(无游标)
|
||||
*/
|
||||
public boolean isFirstPage() {
|
||||
return cursorTime == null && cursorId == null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,81 +0,0 @@
|
||||
package com.zt.plat.module.databus.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 游标分页结果 DTO
|
||||
* <p>
|
||||
* 用于 Databus 全量同步时的断点续传响应
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Schema(description = "游标分页结果")
|
||||
public class CursorPageResult<T> implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@Schema(description = "数据列表")
|
||||
private List<T> list;
|
||||
|
||||
@Schema(description = "下一页游标时间(最后一条数据的创建时间)")
|
||||
private LocalDateTime nextCursorTime;
|
||||
|
||||
@Schema(description = "下一页游标ID(最后一条数据的ID)")
|
||||
private Long nextCursorId;
|
||||
|
||||
@Schema(description = "本次返回的数据量")
|
||||
private Integer count;
|
||||
|
||||
@Schema(description = "是否还有更多数据")
|
||||
private Boolean hasMore;
|
||||
|
||||
@Schema(description = "总数据量(可选,首次查询时返回)")
|
||||
private Long total;
|
||||
|
||||
/**
|
||||
* 构建首页结果
|
||||
*/
|
||||
public static <T> CursorPageResult<T> of(List<T> list, LocalDateTime nextCursorTime,
|
||||
Long nextCursorId, boolean hasMore, Long total) {
|
||||
return CursorPageResult.<T>builder()
|
||||
.list(list)
|
||||
.nextCursorTime(nextCursorTime)
|
||||
.nextCursorId(nextCursorId)
|
||||
.count(list != null ? list.size() : 0)
|
||||
.hasMore(hasMore)
|
||||
.total(total)
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建后续页结果
|
||||
*/
|
||||
public static <T> CursorPageResult<T> of(List<T> list, LocalDateTime nextCursorTime,
|
||||
Long nextCursorId, boolean hasMore) {
|
||||
return of(list, nextCursorTime, nextCursorId, hasMore, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建空结果
|
||||
*/
|
||||
public static <T> CursorPageResult<T> empty() {
|
||||
return CursorPageResult.<T>builder()
|
||||
.list(List.of())
|
||||
.count(0)
|
||||
.hasMore(false)
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user