package catalog import ( "relynolli-server/handlers/catalog/endpoints" "relynolli-server/internal" "time" "github.com/gin-contrib/cache" "github.com/gin-gonic/gin" ) func HandleRoutes(parent *gin.RouterGroup) { h := endpoints.GetHandlers() cacheStore := internal.InitCacheStore() catalog := parent.Group("/catalog") catalog.GET("/filters", cache.CachePage(cacheStore, 15, h.GetFilters)) catalog.GET("/count", cache.CachePage(cacheStore, 15 * time.Minute, h.Count)) catalog.GET("", cache.CachePage(cacheStore, 15 * time.Minute, h.GetCatalogItems)) catalog.GET("/:code", cache.CachePage(cacheStore, 15 * time.Minute, h.GetCatalogItem)) }