plateMate/config/routes.go

35 lines
1.2 KiB
Go

package config
import (
"github.com/gin-gonic/gin"
"plateMate/controllers"
)
func ConfigureRoutes(router *gin.Engine) {
// users endpoints
router.GET("/users", controllers.GetUsers)
router.GET("/users/:id", controllers.GetUserById)
router.POST("/users", controllers.CreateUser)
router.PUT("/users/:id", controllers.UpdateUser)
router.DELETE("/users/:id", controllers.DeleteUser)
// plates endpoints
router.GET("/plates", controllers.GetPlates)
router.GET("/plates/:id", controllers.GetPlateById)
router.POST("/plates", controllers.CreatePlate)
router.PUT("/plates/:id", controllers.UpdatePlate)
router.DELETE("/plates/:id", controllers.DeletePlate)
// orders endpoints
router.GET("/orders", controllers.GetOrders)
router.GET("/orders/:id", controllers.GetOrderById)
router.POST("/orders", controllers.CreateOrder)
router.PUT("/orders/:id", controllers.UpdateOrder)
router.DELETE("/orders/:id", controllers.DeleteOrder)
// auth endpoints
router.POST("/login", controllers.Login)
router.POST("/logout", controllers.Logout)
router.POST("/register", controllers.Register)
}