add query

This commit is contained in:
Yavolte 2025-06-23 17:00:36 +08:00
parent f79d3f28e2
commit 908931bc01
1 changed files with 8 additions and 0 deletions

View File

@ -38,6 +38,14 @@ func (c *Context) Param(key string) string {
return c.ctx.Param(key)
}
func (c *Context) Query(key string) string {
qs := c.ctx.Request.URL.Query()
if qs != nil {
return qs.Get(key)
}
return ""
}
func (c *Context) Bind(val any) (err error) {
// if params exists, try bind params first
if len(c.ctx.Params) > 0 {