This commit is contained in:
Sakurasan
2025-04-17 02:17:19 +08:00
parent d4cbc27a77
commit b0d68ba338
7 changed files with 55 additions and 35 deletions

View File

@@ -38,17 +38,17 @@ func InitTeamHandler(ctx context.Context, cfg *config.Config, db *gorm.DB) (*con
func InitAPIHandler(ctx context.Context, cfg *config.Config, db *gorm.DB) (*controller2.Api, error) {
userDAO := dao.NewUserDAO(db)
userServiceImpl := service2.NewUserService(db, userDAO)
userServiceImpl := service2.NewUserService(cfg, db, userDAO)
tokenDAO := dao.NewTokenDAO(db)
tokenServiceImpl := service2.NewTokenService(db, tokenDAO)
apiKeyDAO := dao.NewApiKeyDAO(db)
apiKeyServiceImpl := service2.NewApiKeyService(db, apiKeyDAO)
webAuthnService, err := service2.NewWebAuthnService(db, cfg)
webAuthnService, err := service2.NewWebAuthnService(cfg, db)
if err != nil {
return nil, err
}
usageService := service2.NewUsageService(ctx, cfg, db)
api := controller2.NewApi(db, userServiceImpl, tokenServiceImpl, apiKeyServiceImpl, webAuthnService, usageService)
api := controller2.NewApi(cfg, db, userServiceImpl, tokenServiceImpl, apiKeyServiceImpl, webAuthnService, usageService)
return api, nil
}