This commit is contained in:
Giovanni Rezcjikov
2026-03-09 18:09:02 +03:00
parent be36c6f0c4
commit f188150c9f
25 changed files with 694 additions and 53 deletions
+4 -1
View File
@@ -35,6 +35,7 @@ func main() {
userRepo := repositories.NewUserRepository(postgres.Pool)
oauthRepo := repositories.NewOAuthRepository(postgres.Pool)
positionRepo := repositories.NewPositionRepository(postgres.Pool)
if err := seedClient(context.Background(), oauthRepo, cfg.Client); err != nil {
log.Fatalf("seed client: %v", err)
@@ -43,6 +44,7 @@ func main() {
svc := services.New(
userRepo,
oauthRepo,
positionRepo,
redis.Client,
services.TokenConfig{
AccessTTL: cfg.JWT.TTL,
@@ -55,8 +57,9 @@ func main() {
authHandler := handlers.NewAuthHandler(svc)
oauthHandler := handlers.NewOAuthHandler(svc, cfg.Server.FrontendURL)
consentHandler := handlers.NewConsentHandler(svc)
positionsHandler := handlers.NewPositionsHandler(svc)
router := http.NewRouter(authHandler, oauthHandler, consentHandler, svc, oauthRepo, limiter)
router := http.NewRouter(authHandler, oauthHandler, consentHandler, positionsHandler, svc, oauthRepo, limiter)
log.Printf("starting server on %s", cfg.Server.Addr)
if err := router.Run(cfg.Server.Addr); err != nil {