diff options
Diffstat (limited to 'pkg/handler/add/handler.go')
-rw-r--r-- | pkg/handler/add/handler.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg/handler/add/handler.go b/pkg/handler/add/handler.go new file mode 100644 index 0000000..8f744ab --- /dev/null +++ b/pkg/handler/add/handler.go @@ -0,0 +1,21 @@ +package add + +import ( + "github.com/labstack/echo/v4" + "github.com/uptrace/bun" +) + +type Handler struct { + db *bun.DB +} + +// NewHandler returns new Handler. +func NewHandler(db *bun.DB) *Handler { + return &Handler{db: db} +} + +func (h *Handler) Register(g *echo.Group) { + g.GET("", h.AddQuote) + g.POST("", h.AddQuotePost) + g.GET("/success", h.AddQuoteSuccess) +} |