diff --git a/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/requests/requests.go b/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/requests/requests.go index 09ce424..5e0c6ff 100644 --- a/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/requests/requests.go +++ b/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/requests/requests.go @@ -30,13 +30,21 @@ type tRequests struct { // New allocates (github.com/colegion/contrib/controllers/requests).Requests controller, // then returns it. func (t tRequests) New(w http.ResponseWriter, r *http.Request, ctr, act string) *contr.Requests { - c := &contr.Requests{} + c := &contr.Requests{ + + Request: r, + } return c } -// Before is a dump method that always returns nil. +// Before calls (github.com/colegion/contrib/controllers/requests).Requests.Before. func (t tRequests) Before(c *contr.Requests, w http.ResponseWriter, r *http.Request) http.Handler { + // Call magic Before action of (github.com/colegion/contrib/controllers/requests).Requests. + if res := c.Before(); res != nil { + return res + } + return nil } @@ -50,8 +58,7 @@ func (t tRequests) After(c *contr.Requests, w http.ResponseWriter, r *http.Reque // of their execution phase. func (t tRequests) Initially(c *contr.Requests, w http.ResponseWriter, r *http.Request, a []string) (finish bool) { - // Call magic Initially method of (github.com/colegion/contrib/controllers/requests).Requests. - return c.Initially(w, r, a) + return } diff --git a/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/sessions/sessions.go b/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/sessions/sessions.go index 860e4b8..aeb62b8 100644 --- a/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/sessions/sessions.go +++ b/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/sessions/sessions.go @@ -30,13 +30,21 @@ type tSessions struct { // New allocates (github.com/colegion/contrib/controllers/sessions).Sessions controller, // then returns it. func (t tSessions) New(w http.ResponseWriter, r *http.Request, ctr, act string) *contr.Sessions { - c := &contr.Sessions{} + c := &contr.Sessions{ + + Request: r, + } return c } -// Before is a dump method that always returns nil. +// Before calls (github.com/colegion/contrib/controllers/sessions).Sessions.Before. func (t tSessions) Before(c *contr.Sessions, w http.ResponseWriter, r *http.Request) http.Handler { + // Call magic Before action of (github.com/colegion/contrib/controllers/sessions).Sessions. + if res := c.Before(); res != nil { + return res + } + return nil } @@ -50,8 +58,7 @@ func (t tSessions) After(c *contr.Sessions, w http.ResponseWriter, r *http.Reque // of their execution phase. func (t tSessions) Initially(c *contr.Sessions, w http.ResponseWriter, r *http.Request, a []string) (finish bool) { - // Call magic Initially method of (github.com/colegion/contrib/controllers/sessions).Sessions. - return c.Initially(w, r, a) + return } diff --git a/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/templates/templates.go b/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/templates/templates.go index a7f211e..a09fe49 100644 --- a/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/templates/templates.go +++ b/internal/skeleton/assets/handlers/github.com/colegion/contrib/controllers/templates/templates.go @@ -31,13 +31,23 @@ type tTemplates struct { // New allocates (github.com/colegion/contrib/controllers/templates).Templates controller, // then returns it. func (t tTemplates) New(w http.ResponseWriter, r *http.Request, ctr, act string) *contr.Templates { - c := &contr.Templates{} + c := &contr.Templates{ + + Action: act, + + Controller: ctr, + } return c } -// Before is a dump method that always returns nil. +// Before calls (github.com/colegion/contrib/controllers/templates).Templates.Before. func (t tTemplates) Before(c *contr.Templates, w http.ResponseWriter, r *http.Request) http.Handler { + // Call magic Before action of (github.com/colegion/contrib/controllers/templates).Templates. + if res := c.Before(); res != nil { + return res + } + return nil } @@ -51,8 +61,7 @@ func (t tTemplates) After(c *contr.Templates, w http.ResponseWriter, r *http.Req // of their execution phase. func (t tTemplates) Initially(c *contr.Templates, w http.ResponseWriter, r *http.Request, a []string) (finish bool) { - // Call magic Initially method of (github.com/colegion/contrib/controllers/templates).Templates. - return c.Initially(w, r, a) + return }