代码提交

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 编码。
File diff suppressed because one or more lines are too long
@@ -39,6 +39,9 @@
<script>
{{JS}}
</script>
<script>
{{SNAPSHOT_JS}}
</script>
</body>
</html>
@@ -395,6 +395,7 @@ function openDubboDebug(card) {
'<button class="dubbo-btn" onclick="copyDubboCurl()">📋 复制 cURL</button>' +
'<button class="dubbo-btn" onclick="copyDubboBody()">📄 复制请求体</button>' +
'<button class="dubbo-btn send" id="dubboSendBtn" onclick="sendDubboRequest()">▶ 发送请求</button>' +
'<button class="dubbo-btn" style="background:#fff7e6;color:#d46b08;border-color:#ffd591" onclick="exportDebugSnapshot()">📸 导出快照</button>' +
'</div>' +
'</div></div>';