fix: issues

This commit is contained in:
Rogee
2025-01-14 11:10:16 +08:00
parent 765918aabc
commit 307c99b9e5
2 changed files with 12 additions and 1 deletions

View File

@@ -73,7 +73,16 @@ func Render(path string, routes []RouteDefinition) error {
case PositionHeader:
return fmt.Sprintf(`Header[%s]("%s")`, item.Type, item.Name), true
case PositionCookie:
return fmt.Sprintf(`Cookie%s[%s]("%s")`, isScalarType(item.Type), item.Type, item.Name), true
key := item.Name
if item.Key != "" {
key = item.Key
}
if item.Type == "string" {
return fmt.Sprintf(`CookieParam("%s")`, key), true
}
return fmt.Sprintf(`Cookie[%s]("%s")`, item.Type, key), true
case PositionBody:
return fmt.Sprintf(`Body[%s]("%s")`, item.Type, item.Name), true
case PositionPath:

View File

@@ -4,6 +4,8 @@ import (
"github.com/gofiber/fiber/v3"
)
var Func0 = Func
func Func(f fiber.Handler) fiber.Handler {
return f
}