feat: 关于本站对齐站点公告,增加全部与管理入口

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-18 01:47:39 +08:00
parent 184489bca2
commit 2ccfb5f330
15 changed files with 384 additions and 80 deletions

View File

@@ -10,6 +10,16 @@ import (
"gorm.io/gorm"
)
// SitePagesList 已发布单页目录(全部页)
func (h *Handlers) SitePagesList(c *gin.Context) {
list, err := h.SitePage.ListPublished()
if err != nil {
c.JSON(http.StatusInternalServerError, gin.H{"error": "获取页面失败"})
return
}
c.JSON(http.StatusOK, gin.H{"pages": nonNilSlice(list)})
}
// SitePageDetail 公开单页详情(按 slug)
func (h *Handlers) SitePageDetail(c *gin.Context) {
slug := c.Param("slug")