This commit is contained in:
2026-01-28 08:10:10 +08:00
10 changed files with 867 additions and 138 deletions

View File

@@ -92,6 +92,12 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
interestService := service.NewInterestService(accountRepo, transactionRepo, db)
userSettingsServiceWithAccounts := service.NewUserSettingsServiceWithAccountRepo(userSettingsRepo, accountRepo)
// Feature: notification-center - Initialize notification service
notificationService := service.NewNotificationService(notificationRepo)
// Feature: health-score - Initialize health score service
healthScoreService := service.NewHealthScoreService(reportRepo, accountRepo, budgetRepo)
// Initialize handlers
accountHandler := handler.NewAccountHandler(accountService)
categoryHandler := handler.NewCategoryHandler(categoryService)
@@ -122,6 +128,12 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
defaultAccountHandler := handler.NewDefaultAccountHandler(userSettingsServiceWithAccounts)
interestHandler := handler.NewInterestHandler(interestService, nil)
// Feature: notification-center - Initialize notification handler
notificationHandler := handler.NewNotificationHandler(notificationService)
// Feature: health-score - Initialize health score handler
healthScoreHandler := handler.NewHealthScoreHandler(healthScoreService)
// AI Bookkeeping Service and Handler
aiBookkeepingService := service.NewAIBookkeepingService(
cfg,
@@ -219,6 +231,9 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
// AI bookkeeping routes
aiHandler.RegisterRoutes(protected)
// Feature: notification-center - Register notification routes
notificationHandler.RegisterRoutes(protected)
// Register report routes
protected.GET("/reports/summary", reportHandler.GetTransactionSummary)
protected.GET("/reports/category", reportHandler.GetCategorySummary)