代码提交

This commit is contained in:
张家训
2026-07-28 21:45:23 +08:00
parent acd74107f9
commit c349254304
5 changed files with 150 additions and 0 deletions
@@ -72,6 +72,7 @@ public class ApiDocGenerator {
.replace("{{GENERATE_TIME}}", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")))
.replace("{{STATS_BAR}}", buildStatsBar(docs.size(), totalClasses, totalMethods))
.replace("{{SIDEBAR}}", buildSidebar(docs))
.replace("{{SNAPSHOT_JS}}", resourceLoader.loadSnapshotJs())
.replace("{{CONTENT}}", buildContent(docs));
}
@@ -53,6 +53,14 @@ public class HtmlResourceLoader {
return loadResource(RESOURCE_BASE + "html2canvas.min.js");
}
/**
* 加载快照导出 JS 脚本。
* 对应资源文件:resources/templates/apidoc/api-doc-snapshot.js
*/
public String loadSnapshotJs() {
return loadResource(RESOURCE_BASE + "api-doc-snapshot.js");
}
/**
* 从 classpath 读取资源文件内容。
* 所有资源必须以 UTF-8 编码。