diff options
Diffstat (limited to 'pkg/handler/user/handler.go')
-rw-r--r-- | pkg/handler/user/handler.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/pkg/handler/user/handler.go b/pkg/handler/user/handler.go new file mode 100644 index 0000000..6bc8bff --- /dev/null +++ b/pkg/handler/user/handler.go @@ -0,0 +1,24 @@ +package user + +import ( + "github.com/labstack/echo/v4" + "go.neonxp.ru/framework/pkg/service/user" +) + +type Handler struct { + user *user.Service +} + +// NewHandler returns new Handler. +func NewHandler(u *user.Service) *Handler { + return &Handler{user: u} +} + +func (h *Handler) Register(g *echo.Group) { + g.GET("/login", h.LoginForm) + g.POST("/login", h.LoginForm) + g.GET("/register", h.RegisterForm) + g.POST("/register", h.RegisterForm) + g.GET("/profile", h.Profile) + g.POST("/logout", h.Logout) +} |