feat(homepage): implement SearchRoute method and enhance item configuration with sorting and visibility features, introduce All and Favorite categories

This commit is contained in:
yusing
2025-09-04 06:31:44 +08:00
parent 7753c90a7e
commit 0edad7377a
5 changed files with 222 additions and 108 deletions

View File

@@ -5,6 +5,7 @@ import (
"github.com/gin-gonic/gin"
apitypes "github.com/yusing/go-proxy/internal/api/types"
config "github.com/yusing/go-proxy/internal/config/types"
"github.com/yusing/go-proxy/internal/route/routes"
)
@@ -35,7 +36,14 @@ func Route(c *gin.Context) {
route, ok := routes.Get(request.Which)
if ok {
c.JSON(http.StatusOK, route)
} else {
c.JSON(http.StatusNotFound, nil)
return
}
// also search for excluded routes
route = config.GetInstance().SearchRoute(request.Which)
if route != nil {
c.JSON(http.StatusOK, route)
return
}
c.JSON(http.StatusNotFound, nil)
}