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
+6 -1
View File
@@ -12,7 +12,7 @@ import (
"github.com/google/uuid"
)
func NewRouter(auth *handlers.AuthHandler, oauth *handlers.OAuthHandler, consents *handlers.ConsentHandler, svc *services.Service, repo *repositories.OAuthRepository, limiter *services.RateLimiter) *gin.Engine {
func NewRouter(auth *handlers.AuthHandler, oauth *handlers.OAuthHandler, consents *handlers.ConsentHandler, positions *handlers.PositionsHandler, svc *services.Service, repo *repositories.OAuthRepository, limiter *services.RateLimiter) *gin.Engine {
r := gin.Default()
r.Use(errorMiddleware())
@@ -39,6 +39,11 @@ func NewRouter(auth *handlers.AuthHandler, oauth *handlers.OAuthHandler, consent
me.DELETE("", authMiddleware(svc, repo, "profile:delete"), auth.DeleteProfile)
me.GET("/consents", authMiddleware(svc, repo, "profile:consent:read"), consents.GetUserConsents)
me.DELETE("/consent/:clientId", authMiddleware(svc, repo, "profile:consent:delete"), consents.RevokeAppAccess)
me.GET("/positions", authMiddleware(svc, repo, "profile:read"), positions.GetMyPositions)
admin := api.Group("/admin")
admin.GET("/positions", authMiddleware(svc, repo), positions.ListPositions)
admin.POST("/positions", authMiddleware(svc, repo), positions.UpsertPosition)
}
return r