增加getuint64/32的方法

This commit is contained in:
2025-12-07 01:09:52 +08:00
parent 5cfa0d7ce5
commit 545c6ef6a4
3 changed files with 54 additions and 0 deletions

View File

@@ -288,6 +288,8 @@ fac.ParseJSON(r, &req)
// 获取查询参数
id := fac.GetQueryInt64(r, "id", 0)
uid := fac.GetQueryUint64(r, "uid", 0)
userId := fac.GetQueryUint32(r, "user_id", 0)
keyword := fac.GetQuery(r, "keyword", "")
// 获取时区需要配合middleware.Timezone使用
@@ -667,6 +669,14 @@ fac.Success(w, user, "获取成功") // 自定义消息
获取查询64位整数参数。
#### GetQueryUint64(r *http.Request, key string, defaultValue uint64) uint64
获取查询64位无符号整数参数。
#### GetQueryUint32(r *http.Request, key string, defaultValue uint32) uint32
获取查询32位无符号整数参数。
#### GetFormValue(r *http.Request, key, defaultValue string) string
获取表单值。