23 lines
442 B
Go
23 lines
442 B
Go
|
package chargers
|
||
|
|
||
|
import (
|
||
|
"onyx-api/internal/config"
|
||
|
|
||
|
"github.com/labstack/echo/v4"
|
||
|
)
|
||
|
|
||
|
type Routes struct {
|
||
|
cfg *config.Config
|
||
|
controller *Controller
|
||
|
}
|
||
|
|
||
|
// New controller constructor
|
||
|
func NewRouter(cfg *config.Config, Controller *Controller) *Routes {
|
||
|
return &Routes{cfg: cfg, controller: Controller}
|
||
|
}
|
||
|
|
||
|
func (r *Routes) MapRoutes(g *echo.Group) {
|
||
|
g.GET("/", r.controller.Ping())
|
||
|
g.GET("/all", r.controller.GetAllProjects())
|
||
|
}
|