Files
old-svijetlastrana/server/router/visitroute/router.go
2018-05-25 09:12:42 +02:00

26 lines
678 B
Go

package visitroute
import (
"bitbucket.org/nemt/nemt-portal-api/application/applicationservice"
"bitbucket.org/nemt/nemt-portal-api/application/tncservice"
"bitbucket.org/nemt/nemt-portal-api/infra/config"
"github.com/labstack/echo"
)
const (
rootRoute = "/"
idRoute = "/:visit_uuid"
rideRoute = "/:visit_uuid/ride"
)
// Register registers the routes in the echo group
func Register(r *echo.Group, cfg *config.Config, svc *applicationservice.Service, tnc *tncservice.Service) {
ctrl := controllerInstance(svc, cfg, tnc)
r.POST(rootRoute, ctrl.handle)
r.POST(rideRoute, ctrl.handleRide)
r.GET(rootRoute, ctrl.handleGetAll)
r.GET(idRoute, ctrl.handleGetByID)
}