包装get query
This commit is contained in:
parent
3298adb55a
commit
a6c94d55b1
@ -10,6 +10,7 @@ package request
|
||||
import (
|
||||
"git.zhangdeman.cn/zhangdeman/wrapper"
|
||||
"github.com/gin-gonic/gin"
|
||||
"net/url"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@ -61,6 +62,18 @@ func (wh *wrapperHandle) GetUri(ctx *gin.Context, defaultVal string) string {
|
||||
return defaultVal
|
||||
}
|
||||
|
||||
// GetQuery 获取query参数
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
//
|
||||
// Date : 16:03 2024/1/2
|
||||
func (wh *wrapperHandle) GetQuery(ctx *gin.Context) url.Values {
|
||||
if nil != ctx && nil != ctx.Request && nil != ctx.Request.URL {
|
||||
return ctx.Request.URL.Query()
|
||||
}
|
||||
return make(url.Values)
|
||||
}
|
||||
|
||||
// GetMethod 获取请求方法
|
||||
//
|
||||
// Author : go_developer@163.com<白茶清欢>
|
||||
|
Loading…
Reference in New Issue
Block a user