func addAPIHandlers()

in api.go [19:33]


func addAPIHandlers(r *gin.RouterGroup, db *sqlx.DB) {
	h := apiHandlers{db}
	r.GET("/stats", h.getStats)
	r.GET("/products", h.getProducts)
	r.GET("/products/:id", h.getProductDetails)
	r.GET("/products/:id/customers", h.getProductCustomers)
	r.GET("/types", h.getProductTypes)
	r.GET("/types/:id", h.getProductTypeDetails)
	r.GET("/customers", h.getCustomers)
	r.GET("/customers/:id", h.getCustomerDetails)
	r.GET("/orders", h.getOrders)
	r.GET("/orders/:id", h.getOrderDetails)
	r.POST("/orders", h.postOrder)
	r.POST("/orders/csv", h.postOrderCSV)
}