feat: 新增「文档」菜单(使用指南 + 接口文档)

- backend/docs/GUIDE.md:使用指南,每功能一句话讲清
  「是什么→怎么用→实用技巧」(快速开始 3 步、流水线快速上手配置、
  GitOps 概念与用法、AI 助手/批量发布/Jenkins/构建节点/工具/
  飞书通知/用户 LDAP/常见问题 FAQ)
- backend/docs/API.md:接口文档(opsx-sec 骨架:通用约定/模块
  索引表/重点端点 curl 示例/状态码速查)
- GET /api/docs:文档 embed 进二进制,运行目录 docs/ 优先可热更新
- /docs 页面:使用指南/接口文档切换 + 左侧目录锚点导航 +
  markdown 渲染(marked + gfm-heading-id,深浅主题适配排版)
- 侧边栏系统组新增「文档」入口(第一位)
This commit is contained in:
Logan.Li committed 2026-10-27 14:45:33 +08:00
1 parent 8ee08e08da
commit ed88a18e03
11 files changed
+480 -53

No files matched your search

+6
View File
@@ -19,6 +19,11 @@ import (
//go:embed all:static
var staticFS embed.FS
// 使用指南与接口文档(运行目录 docs/ 优先)
//
//go:embed docs/GUIDE.md docs/API.md
var docsFS embed.FS
func main() {
if err := database.Init(); err != nil {
panic("数据库初始化失败: " + err.Error())
@@ -67,6 +72,7 @@ func main() {
}
api.POST("/ldap/users", handler.AdminOnly(), handler.LdapListUsers)
api.POST("/settings/ldap/test", handler.AdminOnly(), handler.TestLDAP)
api.GET("/docs", handler.GetDocs(docsFS))
api.GET("/summary", handler.GetSummary)
api.GET("/settings", handler.GetSettings)