Files
old-svijetlastrana/server/router/visitroute/router.go

26 lines
678 B
Go
Raw Normal View History

2018-04-25 13:16:36 +02:00
package visitroute
import (
"bitbucket.org/nemt/nemt-portal-api/application/applicationservice"
2018-05-25 09:12:42 +02:00
"bitbucket.org/nemt/nemt-portal-api/application/tncservice"
2018-04-25 13:16:36 +02:00
"bitbucket.org/nemt/nemt-portal-api/infra/config"
"github.com/labstack/echo"
)
const (
rootRoute = "/"
idRoute = "/:visit_uuid"
2018-05-25 09:12:42 +02:00
rideRoute = "/:visit_uuid/ride"
2018-04-25 13:16:36 +02:00
)
// Register registers the routes in the echo group
2018-05-25 09:12:42 +02:00
func Register(r *echo.Group, cfg *config.Config, svc *applicationservice.Service, tnc *tncservice.Service) {
ctrl := controllerInstance(svc, cfg, tnc)
2018-04-25 13:16:36 +02:00
2018-05-18 18:55:00 +02:00
r.POST(rootRoute, ctrl.handle)
2018-05-25 09:12:42 +02:00
r.POST(rideRoute, ctrl.handleRide)
2018-05-18 18:55:00 +02:00
2018-04-25 13:16:36 +02:00
r.GET(rootRoute, ctrl.handleGetAll)
r.GET(idRoute, ctrl.handleGetByID)
}