同步平台业务模块能力

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

@@ -90,7 +90,10 @@ public class LogApplicationServiceImpl extends AbstractTaskExecuteService implem
if (traceContext0 == null) {
return;
}
redisUtil.rightPush("log:queue", JSON.toJSONString(((TraceContext) traceContext0).getLog()));
TraceContext traceContext = (TraceContext) traceContext0;
LogDocument logDocument = (LogDocument) traceContext.getLog();
logDocument.setApiKey(TraceContext.maskApiKey(traceContext.getApiKey()));
redisUtil.rightPush("log:queue", JSON.toJSONString(logDocument));
((TraceContext) traceContext0).setLog(null);
redisUtil.rightPush("bill:queue", JSON.toJSONString(traceContext0));
}

View File

@@ -69,6 +69,9 @@ public class LogDocument extends SearchDocument {
@Schema(description = "缓存输入token数量")
private Integer cacheInputToken;
@Schema(description = "缓存创建输入token数量")
private Integer cacheCreationInputToken;
@Schema(description = "输入token数量")
private Integer inputToken;
@@ -81,6 +84,9 @@ public class LogDocument extends SearchDocument {
@Schema(description = "请求结束时间")
private Long requestEndTime;
@Schema(description = "API Key")
private String apiKey;
@Schema(description = "执行结果码 0000为成功")
@SearchField(keyword = true)
private String resultCode;

View File

@@ -138,6 +138,8 @@ public abstract class BaseController {
page.setRecords(items.stream().map(item -> {
LogDocument document = (LogDocument) item.getDocument();
document.setProcessData(null);
document.setInput(document.getInput() == null ? null : StringUtils.abbreviate(document.getInput(), 100));
document.setOutput(document.getOutput() == null ? null : StringUtils.abbreviate(document.getOutput(), 100));
return document;
}).collect(Collectors.toList()));
return ReqResult.success(page);