清理与ztcloud中重复的代码,改为 jar 包方式引用 ztcloud

This commit is contained in:
ranke
2026-02-03 15:23:43 +08:00
parent 47e2529b2b
commit 4d997d9b86
3397 changed files with 158 additions and 260291 deletions

View File

@@ -4,16 +4,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.zt.plat</groupId>
<artifactId>zt</artifactId>
<artifactId>zt-dsc</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>zt-module-infra-api</module>
<module>zt-module-infra-server</module>
<module>zt-module-infra-server-app</module>
</modules>
<artifactId>zt-module-infra</artifactId>
<artifactId>zt-module-infra-dsc</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>

View File

@@ -1,47 +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>
<groupId>com.zt.plat</groupId>
<artifactId>zt-module-infra</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>zt-module-infra-api</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
infra 模块 API暴露给其它模块调用
</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>

View File

@@ -1,90 +0,0 @@
package com.zt.plat.module.infra.api.businessfile;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFilePageReqDTO;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileRespDTO;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileSaveReqDTO;
import com.zt.plat.module.infra.api.businessfile.dto.BusinessFileWithUrlRespDTO;
import com.zt.plat.framework.common.enums.RpcConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author chenbowen
*/
@FeignClient(name = RpcConstants.INFRA_NAME)
@Tag(name = "RPC 服务 - 业务附件关联")
public interface BusinessFileApi {
String PREFIX = RpcConstants.INFRA_PREFIX + "/business-file";
@PostMapping(PREFIX + "/create")
@Operation(summary = "创建业务附件关联")
CommonResult<Long> createBusinessFile(@Valid @RequestBody BusinessFileSaveReqDTO createReqDTO);
@PostMapping(PREFIX + "/batch-create")
@Operation(summary = "批量新增业务附件关联")
CommonResult<List<Long>> batchCreateBusinessFile(@RequestBody List<BusinessFileSaveReqDTO> createReqDTOList);
@PostMapping(PREFIX + "/update")
@Operation(summary = "更新业务附件关联")
CommonResult<Boolean> updateBusinessFile(@Valid @RequestBody BusinessFileSaveReqDTO updateReqDTO);
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除业务附件关联")
@Parameter(name = "id", description = "编号", required = true)
CommonResult<Boolean> deleteBusinessFile(@RequestParam("id") Long id);
@DeleteMapping(PREFIX + "/delete-list")
@Operation(summary = "批量删除业务附件关联")
@Parameter(name = "ids", description = "编号列表", required = true)
CommonResult<Boolean> deleteBusinessFileList(@RequestParam("ids") List<Long> ids);
@GetMapping(PREFIX + "/get")
@Operation(summary = "获得业务附件关联")
@Parameter(name = "id", description = "编号", required = true)
CommonResult<BusinessFileRespDTO> getBusinessFile(@RequestParam("id") Long id);
@GetMapping(PREFIX + "/get-by-code")
@Operation(summary = "根据业务编码获得业务附件关联")
@Parameter(name = "businessCode", description = "业务编码", required = true)
CommonResult<BusinessFileRespDTO> getBusinessFileByBusinessCode(@RequestParam("businessCode") String businessCode);
@PostMapping(PREFIX + "/page")
@Operation(summary = "获得业务附件关联分页")
CommonResult<PageResult<BusinessFileRespDTO>> getBusinessFilePage(@RequestBody BusinessFilePageReqDTO pageReqDTO);
@PostMapping(PREFIX + "/page-with-url")
@Operation(summary = "获得业务附件关联分页带URL")
CommonResult<PageResult<BusinessFileWithUrlRespDTO>> getBusinessFilePageWithUrl(@RequestBody BusinessFilePageReqDTO pageReqDTO);
@DeleteMapping(PREFIX + "/delete-by-business")
@Operation(summary = "根据业务Id和来源删除业务附件关联")
@Parameter(name = "businessId", description = "业务Id", required = true)
@Parameter(name = "source", description = "业务来源", required = true)
CommonResult<Boolean> deleteBusinessFileByBusinessIdAndSource(@RequestParam("businessId") Long businessId,
@RequestParam("source") String source);
@PutMapping(PREFIX + "/enable")
@Operation(summary = "启用业务附件关联")
@Parameter(name = "id", description = "编号", required = true)
CommonResult<Boolean> enableBusinessFile(@RequestParam("id") Long id);
@PutMapping(PREFIX + "/disable")
@Operation(summary = "禁用业务附件关联")
@Parameter(name = "id", description = "编号", required = true)
CommonResult<Boolean> disableBusinessFile(@RequestParam("id") Long id);
@PutMapping(PREFIX + "/update-status")
@Operation(summary = "批量更新业务附件状态")
CommonResult<Boolean> updateBusinessFileStatus(@RequestParam("ids") List<Long> ids,
@RequestParam("status") Integer status);
}

View File

@@ -1,51 +0,0 @@
package com.zt.plat.module.infra.api.businessfile.dto;
import com.zt.plat.framework.common.pojo.PageParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 业务附件关联分页查询 DTO
*
* @author 后台管理
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class BusinessFilePageReqDTO extends PageParam implements Serializable {
/**
* 业务Id
*/
private Long businessId;
/**
* 业务编码
*/
private String businessCode;
/**
* 文件名
*/
private String fileName;
/**
* 业务来源
*/
private String source;
/**
* 状态1-正常0-禁用)
*/
private Integer status;
/**
* 创建时间
*/
private LocalDateTime[] createTime;
}

View File

@@ -1,72 +0,0 @@
package com.zt.plat.module.infra.api.businessfile.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* 业务附件关联响应 DTO
*
* @author 后台管理
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BusinessFileRespDTO implements Serializable {
/**
* 编号
*/
private Long id;
/**
* 租户编号
*/
private Long tenantId;
/**
* 业务Id
*/
private Long businessId;
/**
* 业务编码
*/
private String businessCode;
/**
* 文件名
*/
private String fileName;
/**
* 文件Id
*/
private Long fileId;
/**
* 业务来源
*/
private String source;
/**
* 状态1-正常0-禁用)
*/
private Integer status;
/**
* 创建时间
*/
private LocalDateTime createTime;
/**
* 更新时间
*/
private LocalDateTime updateTime;
}

View File

@@ -1,31 +0,0 @@
package com.zt.plat.module.infra.api.businessfile.dto;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* 业务附件关联保存请求 DTO
* @author chenbowen
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class BusinessFileSaveReqDTO implements Serializable {
/** 业务Id */
private Long businessId;
/** 业务编码 */
private String businessCode;
/** 文件名 */
private String fileName;
private Long fileId;
/** 业务来源 */
private String source;
/** 状态1-正常0-禁用) */
private Integer status;
}

View File

@@ -1,59 +0,0 @@
package com.zt.plat.module.infra.api.businessfile.dto;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
/**
* 业务附件关联带URL响应 DTO
*
* @author 后台管理
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class BusinessFileWithUrlRespDTO extends BusinessFileRespDTO {
/**
* 文件路径
*/
private String filePath;
/**
* 文件 URL
*/
private String fileUrl;
/**
* 附件预览地址
*/
private String previewUrl;
/**
* 是否加密
*/
private Boolean isEncrypted;
/**
* 文件MIME类型
*/
private String fileType;
/**
* 文件大小
*/
private Integer fileSize;
/**
* 创建人
*/
private String creator;
/**
* 创建人名称
*/
private String creatorName;
}

View File

@@ -1,21 +0,0 @@
package com.zt.plat.module.infra.api.config;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.infra.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 参数配置")
public interface ConfigApi {
String PREFIX = ApiConstants.PREFIX + "/config";
@GetMapping(PREFIX + "/get-value-by-key")
@Operation(summary = "根据参数键查询参数值")
CommonResult<String> getConfigValueByKey(@RequestParam("key") String key);
}

View File

@@ -1,62 +0,0 @@
package com.zt.plat.module.infra.api.file;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.infra.api.file.dto.FileCreateReqDTO;
import com.zt.plat.module.infra.api.file.dto.FileRespDTO;
import com.zt.plat.module.infra.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotNull;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
@FeignClient(name = ApiConstants.NAME) // TODO ZTfallbackFactory =
@Tag(name = "RPC 服务 - 文件")
public interface FileApi {
String PREFIX = ApiConstants.PREFIX + "/file";
@PostMapping(PREFIX + "/create")
@Operation(summary = "保存文件,并返回文件的访问路径")
CommonResult<String> createFile(@Valid @RequestBody FileCreateReqDTO createReqDTO);
/**
* 创建文件并返回完整文件信息
*
* @param createReqDTO 文件创建请求
* @return 文件完整信息
*/
@PostMapping(PREFIX + "/create-with-return")
@Operation(summary = "创建文件并返回完整文件信息")
CommonResult<FileRespDTO> createFileWithReturn(@Valid @RequestBody FileCreateReqDTO createReqDTO);
/**
* 根据文件编号获取文件信息和二进制内容
*
* @param fileId 文件编号
* @return 文件信息,包含二进制数据
*/
@GetMapping(PREFIX + "/get")
@Operation(summary = "根据文件编号获取文件信息和二进制内容")
CommonResult<FileRespDTO> getFile(@Parameter(description = "文件编号", required = true, example = "1024")
@RequestParam("fileId") @NotNull(message = "文件编号不能为空") Long fileId);
@GetMapping(PREFIX + "/info")
@Operation(summary = "根据文件编号获取文件信息")
CommonResult<FileRespDTO> getFileInfo(@Parameter(description = "文件编号", required = true, example = "1024")
@RequestParam("fileId") @NotNull(message = "文件编号不能为空") Long fileId);
/**
* 删除文件
*
* @param fileId 文件编号
* @return 删除结果
*/
@DeleteMapping(PREFIX + "/delete")
@Operation(summary = "删除文件")
CommonResult<Boolean> deleteFile(@Parameter(description = "文件编号", required = true, example = "1024")
@RequestParam("fileId") @NotNull(message = "文件编号不能为空") Long fileId);
}

View File

@@ -1,26 +0,0 @@
package com.zt.plat.module.infra.api.file.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
@Schema(description = "RPC 服务 - 文件创建 Request DTO")
@Data
public class FileCreateReqDTO {
@Schema(description = "原文件名称", example = "xxx.png")
private String name;
@Schema(description = "文件目录", example = "xxx")
private String directory;
@Schema(description = "文件的 MIME 类型", example = "image/png")
private String type;
@Schema(description = "文件内容", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "文件内容不能为空")
private byte[] content;
@Schema(description = "是否可下载true是false否", example = "true")
private Boolean downloadable;
}

Some files were not shown because too many files have changed in this diff Show More