mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 05:21:57 +00:00
30 lines
1.0 KiB
Cheetah
30 lines
1.0 KiB
Cheetah
{{define "route"}}package {{Kebab .Entity}}s
|
|
|
|
import (
|
|
// m "gitlab.com/mbugroup/lti-api.git/internal/middleware"
|
|
controller "gitlab.com/mbugroup/lti-api.git/internal/modules/{{Kebab .FeatName}}s/controllers"
|
|
{{Camel .Entity}} "gitlab.com/mbugroup/lti-api.git/internal/modules/{{Kebab .FeatName}}s/services"
|
|
user "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"
|
|
|
|
"github.com/gofiber/fiber/v2"
|
|
)
|
|
|
|
func {{Pascal .Entity}}Routes(v1 fiber.Router, u user.UserService, s {{Camel .Entity}}.{{Pascal .Entity}}Service) {
|
|
ctrl := controller.New{{Pascal .Entity}}Controller(s)
|
|
|
|
route := v1.Group("/{{Kebab .Entity}}s")
|
|
|
|
// route.Get("/", m.Auth(u), ctrl.GetAll)
|
|
// route.Post("/", m.Auth(u), ctrl.CreateOne)
|
|
// route.Get("/:id", m.Auth(u), ctrl.GetOne)
|
|
// route.Patch("/:id", m.Auth(u), ctrl.UpdateOne)
|
|
// route.Delete("/:id", m.Auth(u), ctrl.DeleteOne)
|
|
|
|
route.Get("/", ctrl.GetAll)
|
|
route.Post("/", ctrl.CreateOne)
|
|
route.Get("/:id", ctrl.GetOne)
|
|
route.Patch("/:id", ctrl.UpdateOne)
|
|
route.Delete("/:id", ctrl.DeleteOne)
|
|
}
|
|
{{end}}
|