feat: 新增路由配置、通知和公告功能,并初始化相关服务和仓库。

This commit is contained in:
2026-02-02 17:13:33 +08:00
parent 4b2355deee
commit 948be39286
8 changed files with 220 additions and 4 deletions

View File

@@ -51,6 +51,7 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
userRepo := repository.NewUserRepository(db)
notificationRepo := repository.NewNotificationRepository(db)
streakRepo := repository.NewStreakRepository(db)
announcementRepo := repository.NewAnnouncementRepository(db)
// Initialize services (Stage 1: Core Services needed for Auth)
ledgerService := service.NewLedgerService(ledgerRepo, db)
@@ -129,7 +130,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)
notificationHandler := handler.NewNotificationHandler(notificationService, userRepo, announcementRepo)
// Feature: financial-core-upgrade - Initialize new handlers
subAccountHandler := handler.NewSubAccountHandler(subAccountService)
@@ -333,6 +334,7 @@ func SetupWithRedis(db *gorm.DB, yunAPIClient *service.YunAPIClient, redisClient
userRepo := repository.NewUserRepository(db)
notificationRepo := repository.NewNotificationRepository(db)
streakRepo := repository.NewStreakRepository(db)
announcementRepo := repository.NewAnnouncementRepository(db)
// Initialize services (Stage 1: Core Services needed for Auth)
ledgerService := service.NewLedgerService(ledgerRepo, db)
@@ -412,7 +414,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)
notificationHandler := handler.NewNotificationHandler(notificationService, userRepo, announcementRepo)
// Feature: financial-core-upgrade - Initialize new handlers
subAccountHandler := handler.NewSubAccountHandler(subAccountService)