增加站内信未读提醒和后台通知中心+txt 校验

This commit is contained in:
yml2213
2026-06-19 15:24:15 +08:00
parent 8d5094a8d0
commit a4cdc3e806
30 changed files with 1836 additions and 53 deletions
+13
View File
@@ -13,6 +13,7 @@ import (
"hfb_sys/backend/internal/modules/admindashboard"
"hfb_sys/backend/internal/modules/adminfinance"
"hfb_sys/backend/internal/modules/adminmgr"
"hfb_sys/backend/internal/modules/adminnotification"
"hfb_sys/backend/internal/modules/adminrole"
"hfb_sys/backend/internal/modules/adminuser"
"hfb_sys/backend/internal/modules/announcement"
@@ -145,6 +146,12 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
}
adminAuditService := adminaudit.NewService(adminAuditRepo)
adminAuditHandler := adminaudit.NewHandler(adminAuditService)
var adminNotificationRepo *adminnotification.Repository
if deps.DB != nil {
adminNotificationRepo = adminnotification.NewRepository(deps.DB)
}
adminNotificationService := adminnotification.NewService(adminNotificationRepo)
adminNotificationHandler := adminnotification.NewHandler(adminNotificationService)
userHandler := user.NewHandler(userRepo)
var realnameRepo *realname.Repository
if deps.DB != nil {
@@ -447,6 +454,8 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
notificationRoutes := api.Group("/notifications", requireAuth)
{
notificationRoutes.GET("", notificationHandler.List)
notificationRoutes.GET("/unread-count", notificationHandler.UnreadCount)
notificationRoutes.PUT("/read-all", notificationHandler.MarkAllRead)
notificationRoutes.POST("/:id/read", notificationHandler.MarkRead)
}
@@ -542,6 +551,10 @@ func New(cfg config.Config, deps Dependencies, logger *zap.Logger) *gin.Engine {
adminRoutes.GET("/system-configs", requirePerm("system_config:view"), systemConfigHandler.List)
adminRoutes.PUT("/system-configs/:key", requirePerm("system_config:update"), systemConfigHandler.Update)
adminRoutes.GET("/notifications", requirePerm("notification:view"), adminNotificationHandler.List)
adminRoutes.GET("/notifications/unread-count", requirePerm("notification:view"), adminNotificationHandler.UnreadCount)
adminRoutes.PUT("/notifications/read-all", requirePerm("notification:view"), adminNotificationHandler.MarkAllRead)
adminRoutes.POST("/notifications/:id/read", requirePerm("notification:view"), adminNotificationHandler.MarkRead)
adminRoutes.GET("/audit-logs", requirePerm("audit_log:view"), adminAuditHandler.List)
if chatHubHandler != nil {
adminRoutes.GET("/chats/events", requirePerm("chat:view"), chatHubHandler.AdminEvents)