-feat 修复部分bug
This commit is contained in:
@@ -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)
|
||||
@@ -90,6 +91,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)
|
||||
@@ -119,6 +126,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,
|
||||
@@ -216,6 +229,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)
|
||||
|
||||
Reference in New Issue
Block a user