framework/pkg/handler/user/handler.go

25 lines
492 B
Go
Raw Permalink Normal View History

2024-10-12 02:52:22 +03:00
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)
}