Files
lti-api/tools/templates/route.tmpl
T
2025-09-30 16:48:05 +07:00

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}}