blob: 04807c0b0cb10c9665d9bdfa662ac40be6f375e7 (
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
25
26
|
package quote
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.Index)
g.GET("quote/:id", h.Quote)
g.GET("random", h.Random)
g.GET("top", h.Top)
}
type Pagination struct {
Page int `query:"page" default:"0"`
}
|