feat: 添加 Gin 路由器设置,负责初始化所有应用组件和定义路由

This commit is contained in:
2026-02-02 10:26:30 +08:00
parent fa8a35a85b
commit 8b2cf37b18

View File

@@ -75,7 +75,8 @@ func Setup(db *gorm.DB, yunAPIClient *service.YunAPIClient, cfg *config.Config)
classificationService := service.NewClassificationService(classificationRepo, categoryRepo)
transactionService := service.NewTransactionService(transactionRepo, accountRepo, categoryRepo, tagRepo, ledgerRepo, db)
imageService := service.NewImageService(transactionImageRepo, transactionRepo, db, cfg.ImageUploadDir)
recurringService := service.NewRecurringTransactionService(recurringRepo, transactionRepo, accountRepo, categoryRepo, allocationRuleRepo, allocationRecordRepo, piggyBankRepo, userSettingsRepo, db)
smsService := service.NewSmsService(cfg)
recurringService := service.NewRecurringTransactionService(recurringRepo, transactionRepo, accountRepo, categoryRepo, allocationRuleRepo, allocationRecordRepo, piggyBankRepo, userSettingsRepo, smsService, db)
exchangeRateService := service.NewExchangeRateService(exchangeRateRepo)
reportService := service.NewReportService(reportRepo, exchangeRateRepo)
pdfExportService := service.NewPDFExportService(reportRepo, transactionRepo, exchangeRateRepo)
@@ -355,7 +356,8 @@ func SetupWithRedis(db *gorm.DB, yunAPIClient *service.YunAPIClient, redisClient
classificationService := service.NewClassificationService(classificationRepo, categoryRepo)
transactionService := service.NewTransactionService(transactionRepo, accountRepo, categoryRepo, tagRepo, ledgerRepo, db)
imageService := service.NewImageService(transactionImageRepo, transactionRepo, db, cfg.ImageUploadDir)
recurringService := service.NewRecurringTransactionService(recurringRepo, transactionRepo, accountRepo, categoryRepo, allocationRuleRepo, allocationRecordRepo, piggyBankRepo, userSettingsRepo, db)
smsService := service.NewSmsService(cfg)
recurringService := service.NewRecurringTransactionService(recurringRepo, transactionRepo, accountRepo, categoryRepo, allocationRuleRepo, allocationRecordRepo, piggyBankRepo, userSettingsRepo, smsService, db)
reportService := service.NewReportService(reportRepo, exchangeRateRepo)
pdfExportService := service.NewPDFExportService(reportRepo, transactionRepo, exchangeRateRepo)
excelExportService := service.NewExcelExportService(reportRepo, transactionRepo, exchangeRateRepo)