修复数据总线访问日志无法显示状态码问题: http://172.16.46.63:31560/index.php?m=task&f=view&taskID=703. databus 新增 client 统一出口内容管理审计: http://172.16.46.63:31560/index.php?m=task&f=view&taskID=716

This commit is contained in:
ranke
2026-01-22 09:35:13 +08:00
parent bbc1081a47
commit 413ce4c1ef
16 changed files with 659 additions and 13 deletions

1
.gitignore vendored
View File

@@ -61,6 +61,7 @@ package-lock.json
# visual studio code # visual studio code
.history .history
*.log *.log
logs/**
functions/mock functions/mock
.temp/** .temp/**

View File

@@ -72,7 +72,7 @@
<jsoup.version>1.18.1</jsoup.version> <jsoup.version>1.18.1</jsoup.version>
<lombok.version>1.18.36</lombok.version> <lombok.version>1.18.36</lombok.version>
<mapstruct.version>1.6.3</mapstruct.version> <mapstruct.version>1.6.3</mapstruct.version>
<hutool-5.version>5.8.35</hutool-5.version> <hutool-5.version>5.8.43</hutool-5.version>
<hutool-6.version>6.0.0-M19</hutool-6.version> <hutool-6.version>6.0.0-M19</hutool-6.version>
<easyexcel.version>4.0.3</easyexcel.version> <easyexcel.version>4.0.3</easyexcel.version>
<velocity.version>2.4.1</velocity.version> <velocity.version>2.4.1</velocity.version>

View File

@@ -11,6 +11,7 @@
<module>zt-module-databus-api</module> <module>zt-module-databus-api</module>
<module>zt-module-databus-server</module> <module>zt-module-databus-server</module>
<module>zt-module-databus-server-app</module> <module>zt-module-databus-server-app</module>
<module>zt-module-databus-client</module>
</modules> </modules>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@@ -0,0 +1,28 @@
package com.zt.plat.module.databus.api.provider;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.databus.api.dto.ApiAccessLogCreateReq;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import java.util.Map;
/**
* Databus API访问日志接口
* 2026/1/20 16:26
*/
@FeignClient(name = "${databus.provider.log.service:databus-server}")
@Tag(name = "RPC 服务 - Databus API访问日志接口")
public interface DatabusAccessLogProviderApi {
String PREFIX = "/databus/api/portal/access-log";
@PostMapping(PREFIX + "/add")
@Operation(summary = "新增访问日志")
CommonResult<Boolean> add(@RequestHeader Map<String, String> headers, @RequestBody ApiAccessLogCreateReq req);
}

View 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>
<artifactId>zt-module-databus</artifactId>
<groupId>com.zt.plat</groupId>
<version>${revision}</version>
</parent>
<artifactId>zt-module-databus-server-client</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
Databus client, 提供调用第三方服务的能力并记录调用日志。
</description>
<dependencies>
<dependency>
<groupId>com.zt.plat</groupId>
<artifactId>zt-module-databus-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>com.alibaba.cloud</groupId>
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,16 @@
package com.zt.plat.module.databus.client;
/**
*
* 2026/1/21 10:48
*/
import com.zt.plat.module.databus.api.provider.DatabusAccessLogProviderApi;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Configuration;
@Configuration(proxyBeanMethods = false)
@EnableFeignClients(clients = {DatabusAccessLogProviderApi.class})
public class RpcConfiguration {
}

View File

@@ -0,0 +1,3 @@
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.zt.plat.module.databus.client.DatabusClient,\
com.zt.plat.module.databus.client.RpcConfiguration

View File

@@ -0,0 +1,24 @@
package com.zt.plat.module.databus;
import com.zt.plat.module.databus.client.DatabusClient;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
/**
*
* 2026/1/20 14:29
*/
@SpringBootTest(classes = TestApplication.class)
public class DatabusClientTest {
@Autowired
private DatabusClient databusClient;
@Test
void test() {
String result = databusClient.get("https://www.baidu.com/", null, null, "jwyw2", "a5d7cf609c0b47038ea405c660726ee9");
System.out.println(result);
}
}

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