refactor: transitioned auth controller to use the new controller structure;

feat: setup DI for controllers;
refactor: marked old utils and routes package parts as deprecated
This commit is contained in:
2025-07-17 21:42:47 +03:00
parent f9d7439def
commit d6e2d02bff
15 changed files with 437 additions and 1585 deletions

View File

@@ -30,6 +30,7 @@ import (
const requestKey = "request"
// Deprecated: no longer used, embedded into controllers.GetRequest instead
func ClientInfoFromContext(c *gin.Context) (*dto.ClientInfo, bool) {
var ok bool
@@ -58,10 +59,12 @@ func ClientInfoFromContext(c *gin.Context) (*dto.ClientInfo, bool) {
}, true
}
// Deprecated: no longer used, see controllers.GetRequest
func RequestFromContext[T any](c *gin.Context) dto.Request[T] {
return c.Value(requestKey).(dto.Request[T])
}
// Deprecated: no longer used, see controllers.GetRequest
func RequestMiddleware[T any](role enums.Role) gin.HandlerFunc {
return gin.HandlerFunc(func(c *gin.Context) {