isl-api/Routes/PowerItemRoutes.go

20 lines
425 B
Go
Raw Normal View History

package routes
import (
"forgejo.merr.is/annika/isl-api/Controllers"
"github.com/go-chi/chi/v5"
)
func SetupPowerItemRoutes(c Controllers.PowerItemController) *chi.Mux {
r := chi.NewRouter()
r.Get("/", c.GetAll)
r.Get("/asMap", c.GetAllAsMap)
r.Get("/byType/{type:[1-3]}", c.GetAllByType)
r.Get("/byType/{type:[1-3]}/asMap", c.GetAllByTypeAsMap)
r.Post("/", c.Add)
r.Post("/multiple", c.AddMultiple)
return r
}