|
@@ -16,6 +16,7 @@ import (
|
|
|
"net/url"
|
|
"net/url"
|
|
|
"os"
|
|
"os"
|
|
|
"strings"
|
|
"strings"
|
|
|
|
|
+ "strconv"
|
|
|
"time"
|
|
"time"
|
|
|
|
|
|
|
|
"github.com/gin-contrib/sse"
|
|
"github.com/gin-contrib/sse"
|
|
@@ -355,6 +356,12 @@ func (c *Context) Query(key string) string {
|
|
|
return value
|
|
return value
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func (c *Context) QueryInt64(key string) int64 {
|
|
|
|
|
+ value, _ := c.GetQuery(key)
|
|
|
|
|
+ i, _ := strconv.Atoi(value)
|
|
|
|
|
+ return int64(i)
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
// DefaultQuery returns the keyed url query value if it exists,
|
|
// DefaultQuery returns the keyed url query value if it exists,
|
|
|
// otherwise it returns the specified defaultValue string.
|
|
// otherwise it returns the specified defaultValue string.
|
|
|
// See: Query() and GetQuery() for further information.
|
|
// See: Query() and GetQuery() for further information.
|