优化页面、修复BUG

This commit is contained in:
李琦
2026-06-24 16:50:04 +08:00
parent 88ba9be318
commit 3f653bc336
36 changed files with 1672 additions and 2401 deletions

View File

@@ -56,6 +56,7 @@ func main() {
// 博客路由
api.GET("/posts", handlers.GetPosts)
api.GET("/posts/:id", handlers.GetPost)
api.GET("/search/hot", handlers.GetHotSearches)
api.GET("/posts/:id/recommendations", handlers.GetRecommendedPosts)
// 分类路由
@@ -168,6 +169,8 @@ func main() {
// 文章历史记录
authAdmin.GET("/posts/:id/history", middleware.PermissionMiddleware("posts", "read"), handlers.AdminGetPostHistory)
authAdmin.GET("/posts/:id/history/diff", middleware.PermissionMiddleware("posts", "read"), handlers.AdminGetPostHistoryDiff)
authAdmin.POST("/posts/:id/history/:version/restore", middleware.PermissionMiddleware("posts", "update"), handlers.AdminRestorePostHistory)
authAdmin.GET("/posts/:id/history/:version", middleware.PermissionMiddleware("posts", "read"), handlers.AdminGetPostHistoryByVersion)
// 操作日志管理