mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
24 lines
722 B
Go
24 lines
722 B
Go
package products
|
|
|
|
import (
|
|
m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
|
|
controller "gitlab.com/mbugroup/lti-api.git/internal/modules/master/products/controllers"
|
|
product "gitlab.com/mbugroup/lti-api.git/internal/modules/master/products/services"
|
|
user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func ProductRoutes(v1 fiber.Router, u user.UserService, s product.ProductService) {
|
|
ctrl := controller.NewProductController(s)
|
|
|
|
route := v1.Group("/products")
|
|
route.Use(m.Auth(u))
|
|
|
|
route.Get("/", ctrl.GetAll)
|
|
route.Post("/", ctrl.CreateOne)
|
|
route.Get("/:id", ctrl.GetOne)
|
|
route.Patch("/:id", ctrl.UpdateOne)
|
|
route.Delete("/:id", ctrl.DeleteOne)
|
|
}
|