refactor(test): 重构测试套件结构并优化测试配置

feat(test-suite): 新增测试套件模块,包含API测试客户端和测试配置
fix(api): 修复数据库实体和仓库的删除操作返回值
style(api): 统一数据库表名和字段命名
perf(api): 添加缓存注解提升配置查询性能
test(api): 添加H2测试数据库配置支持
chore: 清理旧的测试文件和脚本
This commit is contained in:
张翔
2026-04-01 20:57:24 +08:00
parent 24422c2c19
commit 1e3dc11d59
180 changed files with 15421 additions and 3797 deletions
@@ -5,7 +5,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.stereotype.Service;
import java.time.Instant;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@@ -38,11 +37,8 @@ public class AuditLogService {
entry.setRequestId(requestId);
entry.setMethod(request.getMethod().name());
entry.setPath(request.getPath().value());
entry.setQuery(request.getURI().getQuery());
entry.setUserId(userId);
entry.setClientIp(getClientIp(request));
entry.setStartTime(Instant.now());
entry.setUserAgent(request.getHeaders().getFirst("User-Agent"));
auditEntries.put(requestId, entry);
@@ -59,7 +55,6 @@ public class AuditLogService {
if (entry != null) {
entry.setStatusCode(statusCode);
entry.setEndTime(Instant.now());
entry.setDurationMs(durationMs);
auditLogger.info("[RESPONSE] {} {} - Status: {}, Duration: {}ms, RequestId: {}",
@@ -148,12 +143,8 @@ public class AuditLogService {
private String requestId;
private String method;
private String path;
private String query;
private String userId;
private String clientIp;
private String userAgent;
private Instant startTime;
private Instant endTime;
private int statusCode;
private long durationMs;
@@ -181,10 +172,6 @@ public class AuditLogService {
this.path = path;
}
public void setQuery(String query) {
this.query = query;
}
public String getUserId() {
return userId;
}
@@ -201,18 +188,6 @@ public class AuditLogService {
this.clientIp = clientIp;
}
public void setUserAgent(String userAgent) {
this.userAgent = userAgent;
}
public void setStartTime(Instant startTime) {
this.startTime = startTime;
}
public void setEndTime(Instant endTime) {
this.endTime = endTime;
}
public int getStatusCode() {
return statusCode;
}