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:
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user