-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
subscriptions.go
35 lines (29 loc) · 885 Bytes
/
subscriptions.go
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
27
28
29
30
31
32
33
34
package subscriptions
import (
"github.com/gofiber/fiber/v2"
"github.com/mrusme/journalist/ent"
"github.com/mrusme/journalist/lib"
"go.uber.org/zap"
)
type handler struct {
jctx *lib.JournalistContext
config *lib.Config
entClient *ent.Client
logger *zap.Logger
}
func Register(
jctx *lib.JournalistContext,
fiberRouter *fiber.Router,
) () {
endpoint := new(handler)
endpoint.jctx = jctx
endpoint.config = endpoint.jctx.Config
endpoint.entClient = endpoint.jctx.EntClient
endpoint.logger = endpoint.jctx.Logger
subscriptionsRouter := (*fiberRouter).Group("/subscriptions")
subscriptionsRouter.Get("/", endpoint.List)
// subscriptionsRouter.Get("/:id", endpoint.Show)
// subscriptionsRouter.Post("/", endpoint.Create)
// subscriptionsRouter.Put("/:id", endpoint.Update)
// subscriptionsRouter.Delete("/:id", endpoint.Destroy)
}