feat: 关于本站对齐站点公告,增加全部与管理入口
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user