fix(rules): uncomment code

This commit is contained in:
yusing
2026-02-06 12:02:18 +08:00
parent a6fed3f221
commit cd94479030

View File

@@ -10,11 +10,13 @@ import (
"strings" "strings"
"github.com/rs/zerolog" "github.com/rs/zerolog"
entrypoint "github.com/yusing/godoxy/internal/entrypoint/types"
"github.com/yusing/godoxy/internal/logging" "github.com/yusing/godoxy/internal/logging"
gphttp "github.com/yusing/godoxy/internal/net/gphttp" gphttp "github.com/yusing/godoxy/internal/net/gphttp"
nettypes "github.com/yusing/godoxy/internal/net/types" nettypes "github.com/yusing/godoxy/internal/net/types"
"github.com/yusing/godoxy/internal/notif" "github.com/yusing/godoxy/internal/notif"
"github.com/yusing/godoxy/internal/route/routes" "github.com/yusing/godoxy/internal/route/routes"
"github.com/yusing/godoxy/internal/types"
gperr "github.com/yusing/goutils/errs" gperr "github.com/yusing/goutils/errs"
httputils "github.com/yusing/goutils/http" httputils "github.com/yusing/goutils/http"
"github.com/yusing/goutils/http/reverseproxy" "github.com/yusing/goutils/http/reverseproxy"
@@ -194,23 +196,21 @@ var commands = map[string]struct {
return args[0], nil return args[0], nil
}, },
build: func(args any) CommandHandler { build: func(args any) CommandHandler {
// route := args.(string) route := args.(string)
return TerminatingCommand(func(w http.ResponseWriter, req *http.Request) error { return TerminatingCommand(func(w http.ResponseWriter, req *http.Request) error {
ep := entrypoint.FromCtx(req.Context())
// FIXME: circular dependency r, ok := ep.HTTPRoutes().Get(route)
// ep := entrypoint.FromCtx(req.Context()) if !ok {
// r, ok := ep.HTTPRoutes().Get(route) excluded, has := ep.ExcludedRoutes().Get(route)
// if !ok { if has {
// excluded, has := ep.ExcludedRoutes().Get(route) r, ok = excluded.(types.HTTPRoute)
// if has { }
// r, ok = excluded.(types.HTTPRoute) }
// } if ok {
// } r.ServeHTTP(w, req)
// if ok { } else {
// r.ServeHTTP(w, req) http.Error(w, fmt.Sprintf("Route %q not found", route), http.StatusNotFound)
// } else { }
// http.Error(w, fmt.Sprintf("Route %q not found", route), http.StatusNotFound)
// }
return nil return nil
}) })
}, },