feat: 新增排行榜模块
- 新增 leaderboard 服务与 handler、前端排行榜页面 - 路由与首页入口适配
This commit is contained in:
@@ -75,6 +75,7 @@ func Setup(cfg *config.Config) (*gin.Engine, error) {
|
||||
uploadSvc.WithOperations(ops)
|
||||
postFileSvc.WithOperations(ops)
|
||||
pointsSvc := service.NewPointsService(model.DB)
|
||||
leaderboardSvc := service.NewLeaderboardService(model.DB)
|
||||
adminUserSvc := service.NewAdminUserService(model.DB)
|
||||
legacyImportSvc := service.NewLegacyImportService(model.DB, filepath.Join(cfg.DataDir, "uploads"))
|
||||
moderationSvc := service.NewModerationService(model.DB, notifSvc)
|
||||
@@ -126,6 +127,7 @@ func Setup(cfg *config.Config) (*gin.Engine, error) {
|
||||
Ads: adSvc,
|
||||
Sidebar: service.NewSidebarService(model.DB),
|
||||
Badge: badgeSvc,
|
||||
LeaderboardSvc: leaderboardSvc,
|
||||
}
|
||||
// 通知落库后统一推 WS 红点(点赞/评论/审核/@ 等共用)
|
||||
notifSvc.OnNotifyNew = func(userID uint) {
|
||||
@@ -175,6 +177,8 @@ func Setup(cfg *config.Config) (*gin.Engine, error) {
|
||||
pubAPI.GET("/pages", h.SitePagesList)
|
||||
pubAPI.GET("/pages/:slug", h.SitePageDetail)
|
||||
pubAPI.GET("/settings", h.PublicSettings)
|
||||
pubAPI.GET("/leaderboard", h.Leaderboard)
|
||||
pubAPI.GET("/leaderboard/me", h.LeaderboardMe)
|
||||
pubAPI.GET("/site-state", h.SiteState)
|
||||
pubAPI.GET("/media/:object", h.PublicObject)
|
||||
pubAPI.POST("/auth/code", middleware.CSRFMiddleware(), h.SendEmailCode)
|
||||
|
||||
Reference in New Issue
Block a user