同步平台业务模块能力

This commit is contained in:
baiyanyun
2026-07-13 09:13:30 +08:00
parent e612f5e434
commit a1a38f62d8
224 changed files with 22331 additions and 1224 deletions

View File

@@ -49,8 +49,10 @@ public class TraceContext {
private Object log;
private TokenUsage tokenUsage;
private DurationUsage durationUsage;
private Long subscriptionId;
private String apiKey;
private boolean error;
private String errorCode;
@@ -73,10 +75,19 @@ public class TraceContext {
.billUserId(billUserId)
.enableSubscription(enableSubscription)
.conversationId(conversationId)
.apiKey(apiKey)
.traceTargets(nextTraceTargets)
.build();
}
public static String maskApiKey(String apiKey) {
//apiKey只取前面4位和后4位
if (apiKey != null && apiKey.length() >= 8) {
return apiKey.substring(0, 4) + "****" + apiKey.substring(apiKey.length() - 4);
}
return apiKey;
}
@Data
@AllArgsConstructor
@@ -115,4 +126,12 @@ public class TraceContext {
public long inputTokens = 0;
public long outputTokens = 0;
}
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public static class DurationUsage {
public long duration = 0;
}
}

View File

@@ -66,6 +66,7 @@ public class UserAccessKeyDto {
@Schema(description = "API 授权配置")
private List<ApiConfig> apiConfigs;
private List<Long> modelIds;
private Object ext;
}
@Data