1.规范增量 SQL 文件命名
2.新增数据总线模块(未完成) 3.新增规则模块(未完成) 4.新增组织编码与外部系统组织编码映射关系表 5.补全 e 办单点登录回调逻辑
This commit is contained in:
@@ -1,24 +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</artifactId>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modules>
|
||||
<module>zt-module-rule-api</module>
|
||||
<module>zt-module-rule-server</module>
|
||||
</modules>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>zt-module-rule</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>${project.artifactId}</name>
|
||||
<description>
|
||||
Rule 模块。
|
||||
</description>
|
||||
|
||||
</project>
|
||||
@@ -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-rule</artifactId>
|
||||
<groupId>com.zt.plat</groupId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>zt-module-rule-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>
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.zt.plat.module.rule.api;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.module.rule.api.dto.RuleChainExecuteMetaRespDTO;
|
||||
import com.zt.plat.module.rule.api.dto.RuleChainLoadReqDTO;
|
||||
import com.zt.plat.module.rule.api.dto.RuleChainVersionRespDTO;
|
||||
import com.zt.plat.module.rule.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 org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* RPC interface to expose rule engine capabilities to other micro services.
|
||||
*/
|
||||
@FeignClient(name = ApiConstants.NAME)
|
||||
@Tag(name = "RPC 服务 - 规则引擎")
|
||||
public interface RuleEngineApi {
|
||||
|
||||
String PREFIX = ApiConstants.PREFIX + "/engine";
|
||||
|
||||
@PostMapping(PREFIX + "/load")
|
||||
@Operation(summary = "按业务+版本加载链路执行元数据")
|
||||
CommonResult<RuleChainExecuteMetaRespDTO> loadChain(@Valid @RequestBody RuleChainLoadReqDTO reqDTO);
|
||||
|
||||
@GetMapping(PREFIX + "/latest")
|
||||
@Operation(summary = "获取业务最新链路")
|
||||
CommonResult<RuleChainExecuteMetaRespDTO> getLatestChain(@Parameter(description = "业务标识", required = true)
|
||||
@RequestParam("business") String business);
|
||||
|
||||
@GetMapping(PREFIX + "/versions")
|
||||
@Operation(summary = "查询业务链路版本列表")
|
||||
CommonResult<List<RuleChainVersionRespDTO>> listChainVersions(@Parameter(description = "业务标识", required = true)
|
||||
@RequestParam("business") String business);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.zt.plat.module.rule.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Response DTO exposing the LiteFlow execution metadata for a business chain.
|
||||
*/
|
||||
@Data
|
||||
public class RuleChainExecuteMetaRespDTO {
|
||||
|
||||
@Schema(description = "业务标识", example = "order.create")
|
||||
private String business;
|
||||
|
||||
@Schema(description = "链路版本", example = "v3")
|
||||
private String version;
|
||||
|
||||
@Schema(description = "LiteFlow 链路唯一标识", example = "order.create:v3")
|
||||
private String chainId;
|
||||
|
||||
@Schema(description = "LiteFlow DSL 内容", example = "{\"chain\":...}")
|
||||
private String liteflowDsl;
|
||||
|
||||
@Schema(description = "发布状态", example = "1")
|
||||
private Integer status;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.zt.plat.module.rule.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Request DTO used when remote services need to fetch a LiteFlow chain.
|
||||
*/
|
||||
@Data
|
||||
public class RuleChainLoadReqDTO {
|
||||
|
||||
@Schema(description = "业务标识", example = "order.create")
|
||||
@NotBlank(message = "业务标识不能为空")
|
||||
private String business;
|
||||
|
||||
@Schema(description = "链路版本,空则返回最新版本", example = "v3")
|
||||
private String version;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.zt.plat.module.rule.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Simplified view of a chain for dropdowns or quick lookups.
|
||||
*/
|
||||
@Data
|
||||
public class RuleChainSimpleRespDTO {
|
||||
|
||||
@Schema(description = "链编号", example = "1001")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "链编码", example = "order_main_flow")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "链名称", example = "订单主流程")
|
||||
private String name;
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.rule.api.dto;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* DTO describing available chain versions for a business code.
|
||||
*/
|
||||
@Data
|
||||
public class RuleChainVersionRespDTO {
|
||||
|
||||
@Schema(description = "业务标识", example = "order.create")
|
||||
private String business;
|
||||
|
||||
@Schema(description = "链路版本", example = "v3")
|
||||
private String version;
|
||||
|
||||
@Schema(description = "绑定的链编码", example = "order_main_flow")
|
||||
private String chainCode;
|
||||
|
||||
@Schema(description = "发布状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "发布人", example = "1001")
|
||||
private Long releaseUserId;
|
||||
|
||||
@Schema(description = "发布时间")
|
||||
private LocalDateTime releaseTime;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.zt.plat.module.rule.enums;
|
||||
|
||||
import com.zt.plat.framework.common.enums.RpcConstants;
|
||||
|
||||
/**
|
||||
* RPC constants for the Rule module.
|
||||
*/
|
||||
public interface ApiConstants {
|
||||
|
||||
/**
|
||||
* Spring service name for the rule module. Must align with spring.application.name.
|
||||
*/
|
||||
String NAME = "rule-server";
|
||||
|
||||
/**
|
||||
* Prefix used by rule RPC endpoints.
|
||||
*/
|
||||
String PREFIX = RpcConstants.RPC_API_PREFIX + "/rule";
|
||||
|
||||
/**
|
||||
* RPC contract version.
|
||||
*/
|
||||
String VERSION = "1.0.0";
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.zt.plat.module.rule.enums;
|
||||
|
||||
import com.zt.plat.framework.common.exception.ErrorCode;
|
||||
|
||||
/**
|
||||
* rule 错误码枚举类
|
||||
*
|
||||
* rule 系统,使用 1-xxx-xxx-xxx 段
|
||||
*
|
||||
* @author ZT
|
||||
*/
|
||||
public interface ErrorCodeConstants {
|
||||
|
||||
// ========== 示例模块 1-001-000-000 ==========
|
||||
ErrorCode EXAMPLE_NOT_EXISTS = new ErrorCode(1_001_000_001, "示例不存在");
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.zt.plat.module.rule.enums;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* Strategies supported when a child business inherits parent chains.
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OverrideStrategyEnum {
|
||||
|
||||
/**
|
||||
* Fully inherit parent chain without change.
|
||||
*/
|
||||
INHERIT(0, "继承"),
|
||||
/**
|
||||
* Override nodes with the same code in parent chain.
|
||||
*/
|
||||
OVERRIDE(1, "覆盖"),
|
||||
/**
|
||||
* Disable matched nodes from parent chain.
|
||||
*/
|
||||
DISABLE(2, "禁用"),
|
||||
/**
|
||||
* Append additional nodes after inherited chain.
|
||||
*/
|
||||
APPEND(3, "追加");
|
||||
|
||||
private final Integer strategy;
|
||||
private final String label;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user