aboutsummaryrefslogtreecommitdiff
path: root/pkg/handler/rate/handler.go
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-08 03:43:08 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-10-08 03:50:53 +0300
commite849e705c30cceec3cf7336a21bed96c8a911e90 (patch)
tree93f559bcd4cf3e53193930d112e564a2b7462ac8 /pkg/handler/rate/handler.go
parent3ee654f6fb3cdf119630bfba8066c96ec26428c3 (diff)
Добавил рейтинг
Добавил страницу топа Добавил rss/xml/json feed
Diffstat (limited to 'pkg/handler/rate/handler.go')
-rw-r--r--pkg/handler/rate/handler.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/pkg/handler/rate/handler.go b/pkg/handler/rate/handler.go
new file mode 100644
index 0000000..1a2ecf3
--- /dev/null
+++ b/pkg/handler/rate/handler.go
@@ -0,0 +1,19 @@
+package rate
+
+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.POST("/:id", h.Rate)
+}