framework/pkg/handler/user/handler.go

24 lines
492 B
Go

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)
}