feat: 实现用户通知系统,包含通知模型、数据操作、业务逻辑及相关API接口。

This commit is contained in:
2026-01-28 08:08:14 +08:00
parent f1a390a1ef
commit 8e9c0e9024
5 changed files with 325 additions and 0 deletions

View File

@@ -49,6 +49,7 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
ledgerRepo := repository.NewLedgerRepository(db)
userSettingsRepo := repository.NewUserSettingsRepository(db)
userRepo := repository.NewUserRepository(db)
notificationRepo := repository.NewNotificationRepository(db)
// Initialize auth services
authService := service.NewAuthService(userRepo, cfg)
@@ -83,6 +84,7 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
reimbursementService := service.NewReimbursementService(db, transactionRepo, accountRepo)
refundService := service.NewRefundService(db, transactionRepo, accountRepo)
userSettingsService := service.NewUserSettingsService(userSettingsRepo)
notificationService := service.NewNotificationService(notificationRepo)
// Feature: financial-core-upgrade - Initialize new services
subAccountService := service.NewSubAccountService(accountRepo, db)
@@ -112,6 +114,7 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
reimbursementHandler := handler.NewReimbursementHandler(reimbursementService)
refundHandler := handler.NewRefundHandler(refundService)
settingsHandler := handler.NewSettingsHandler(userSettingsService)
notificationHandler := handler.NewNotificationHandler(notificationService)
// Feature: financial-core-upgrade - Initialize new handlers
subAccountHandler := handler.NewSubAccountHandler(subAccountService)
@@ -237,6 +240,9 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
protected.POST("/app-lock/verify", appLockHandler.VerifyPassword)
protected.POST("/app-lock/disable", appLockHandler.DisableLock)
protected.POST("/app-lock/password/change", appLockHandler.ChangePassword)
// Register notification routes
notificationHandler.RegisterRoutes(protected)
}
}
@@ -297,6 +303,7 @@ func SetupWithRedis(db *gorm.DB, yunAPIClient *service.YunAPIClient, redisClient
ledgerRepo := repository.NewLedgerRepository(db)
userSettingsRepo := repository.NewUserSettingsRepository(db)
userRepo := repository.NewUserRepository(db)
notificationRepo := repository.NewNotificationRepository(db)
// Initialize auth services
authService := service.NewAuthService(userRepo, cfg)
@@ -330,6 +337,7 @@ func SetupWithRedis(db *gorm.DB, yunAPIClient *service.YunAPIClient, redisClient
reimbursementService := service.NewReimbursementService(db, transactionRepo, accountRepo)
refundService := service.NewRefundService(db, transactionRepo, accountRepo)
userSettingsService := service.NewUserSettingsService(userSettingsRepo)
notificationService := service.NewNotificationService(notificationRepo)
// Feature: financial-core-upgrade - Initialize new services
subAccountService := service.NewSubAccountService(accountRepo, db)
@@ -365,6 +373,7 @@ func SetupWithRedis(db *gorm.DB, yunAPIClient *service.YunAPIClient, redisClient
reimbursementHandler := handler.NewReimbursementHandler(reimbursementService)
refundHandler := handler.NewRefundHandler(refundService)
settingsHandler := handler.NewSettingsHandler(userSettingsService)
notificationHandler := handler.NewNotificationHandler(notificationService)
// Feature: financial-core-upgrade - Initialize new handlers
subAccountHandler := handler.NewSubAccountHandler(subAccountService)
@@ -500,6 +509,9 @@ func SetupWithRedis(db *gorm.DB, yunAPIClient *service.YunAPIClient, redisClient
v1.POST("/app-lock/verify", appLockHandler.VerifyPassword)
v1.POST("/app-lock/disable", appLockHandler.DisableLock)
v1.POST("/app-lock/password/change", appLockHandler.ChangePassword)
// Register notification routes
notificationHandler.RegisterRoutes(protected)
}
return r, syncScheduler