aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/user/handler.go
blob: b23003f1de2a2459e401d5551551ee0adf952214 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package user

import (
	"github.com/labstack/echo/v4"
	"neonxp.ru/go/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)
}