add Get*Int32/Get*Int64/Get*Uint32/Get*Uint64 functions for ghttp.Request

This commit is contained in:
John 2019-10-10 10:33:14 +08:00
parent 3082c7f761
commit f1119e28e8
5 changed files with 80 additions and 0 deletions

View File

@ -62,6 +62,14 @@ func (r *Request) GetDeleteInt(key string, def ...interface{}) int {
return r.GetDeleteVar(key, def...).Int() return r.GetDeleteVar(key, def...).Int()
} }
func (r *Request) GetDeleteInt32(key string, def ...interface{}) int32 {
return r.GetDeleteVar(key, def...).Int32()
}
func (r *Request) GetDeleteInt64(key string, def ...interface{}) int64 {
return r.GetDeleteVar(key, def...).Int64()
}
func (r *Request) GetDeleteInts(key string, def ...interface{}) []int { func (r *Request) GetDeleteInts(key string, def ...interface{}) []int {
return r.GetDeleteVar(key, def...).Ints() return r.GetDeleteVar(key, def...).Ints()
} }
@ -70,6 +78,14 @@ func (r *Request) GetDeleteUint(key string, def ...interface{}) uint {
return r.GetDeleteVar(key, def...).Uint() return r.GetDeleteVar(key, def...).Uint()
} }
func (r *Request) GetDeleteUint32(key string, def ...interface{}) uint32 {
return r.GetDeleteVar(key, def...).Uint32()
}
func (r *Request) GetDeleteUint64(key string, def ...interface{}) uint64 {
return r.GetDeleteVar(key, def...).Uint64()
}
func (r *Request) GetDeleteFloat32(key string, def ...interface{}) float32 { func (r *Request) GetDeleteFloat32(key string, def ...interface{}) float32 {
return r.GetDeleteVar(key, def...).Float32() return r.GetDeleteVar(key, def...).Float32()
} }

View File

@ -95,6 +95,14 @@ func (r *Request) GetPostInt(key string, def ...interface{}) int {
return r.GetPostVar(key, def...).Int() return r.GetPostVar(key, def...).Int()
} }
func (r *Request) GetPostInt32(key string, def ...interface{}) int32 {
return r.GetPostVar(key, def...).Int32()
}
func (r *Request) GetPostInt64(key string, def ...interface{}) int64 {
return r.GetPostVar(key, def...).Int64()
}
func (r *Request) GetPostInts(key string, def ...interface{}) []int { func (r *Request) GetPostInts(key string, def ...interface{}) []int {
return r.GetPostVar(key, def...).Ints() return r.GetPostVar(key, def...).Ints()
} }
@ -103,6 +111,14 @@ func (r *Request) GetPostUint(key string, def ...interface{}) uint {
return r.GetPostVar(key, def...).Uint() return r.GetPostVar(key, def...).Uint()
} }
func (r *Request) GetPostUint32(key string, def ...interface{}) uint32 {
return r.GetPostVar(key, def...).Uint32()
}
func (r *Request) GetPostUint64(key string, def ...interface{}) uint64 {
return r.GetPostVar(key, def...).Uint64()
}
func (r *Request) GetPostFloat32(key string, def ...interface{}) float32 { func (r *Request) GetPostFloat32(key string, def ...interface{}) float32 {
return r.GetPostVar(key, def...).Float32() return r.GetPostVar(key, def...).Float32()
} }

View File

@ -61,6 +61,14 @@ func (r *Request) GetPutInt(key string, def ...interface{}) int {
return r.GetPutVar(key, def...).Int() return r.GetPutVar(key, def...).Int()
} }
func (r *Request) GetPutInt32(key string, def ...interface{}) int32 {
return r.GetPutVar(key, def...).Int32()
}
func (r *Request) GetPutInt64(key string, def ...interface{}) int64 {
return r.GetPutVar(key, def...).Int64()
}
func (r *Request) GetPutInts(key string, def ...interface{}) []int { func (r *Request) GetPutInts(key string, def ...interface{}) []int {
return r.GetPutVar(key, def...).Ints() return r.GetPutVar(key, def...).Ints()
} }
@ -69,6 +77,14 @@ func (r *Request) GetPutUint(key string, def ...interface{}) uint {
return r.GetPutVar(key, def...).Uint() return r.GetPutVar(key, def...).Uint()
} }
func (r *Request) GetPutUint32(key string, def ...interface{}) uint32 {
return r.GetPutVar(key, def...).Uint32()
}
func (r *Request) GetPutUint64(key string, def ...interface{}) uint64 {
return r.GetPutVar(key, def...).Uint64()
}
func (r *Request) GetPutFloat32(key string, def ...interface{}) float32 { func (r *Request) GetPutFloat32(key string, def ...interface{}) float32 {
return r.GetPutVar(key, def...).Float32() return r.GetPutVar(key, def...).Float32()
} }

View File

@ -66,6 +66,14 @@ func (r *Request) GetQueryInt(key string, def ...interface{}) int {
return r.GetQueryVar(key, def...).Int() return r.GetQueryVar(key, def...).Int()
} }
func (r *Request) GetQueryInt32(key string, def ...interface{}) int32 {
return r.GetQueryVar(key, def...).Int32()
}
func (r *Request) GetQueryInt64(key string, def ...interface{}) uint64 {
return r.GetQueryVar(key, def...).Uint64()
}
func (r *Request) GetQueryInts(key string, def ...interface{}) []int { func (r *Request) GetQueryInts(key string, def ...interface{}) []int {
return r.GetQueryVar(key, def...).Ints() return r.GetQueryVar(key, def...).Ints()
} }
@ -74,6 +82,14 @@ func (r *Request) GetQueryUint(key string, def ...interface{}) uint {
return r.GetQueryVar(key, def...).Uint() return r.GetQueryVar(key, def...).Uint()
} }
func (r *Request) GetQueryUint32(key string, def ...interface{}) uint32 {
return r.GetQueryVar(key, def...).Uint32()
}
func (r *Request) GetQueryUint64(key string, def ...interface{}) uint64 {
return r.GetQueryVar(key, def...).Uint64()
}
func (r *Request) GetQueryFloat32(key string, def ...interface{}) float32 { func (r *Request) GetQueryFloat32(key string, def ...interface{}) float32 {
return r.GetQueryVar(key, def...).Float32() return r.GetQueryVar(key, def...).Float32()
} }

View File

@ -67,6 +67,14 @@ func (r *Request) GetRequestInt(key string, def ...interface{}) int {
return r.GetRequestVar(key, def...).Int() return r.GetRequestVar(key, def...).Int()
} }
func (r *Request) GetRequestInt32(key string, def ...interface{}) int32 {
return r.GetRequestVar(key, def...).Int32()
}
func (r *Request) GetRequestInt64(key string, def ...interface{}) int64 {
return r.GetRequestVar(key, def...).Int64()
}
func (r *Request) GetRequestInts(key string, def ...interface{}) []int { func (r *Request) GetRequestInts(key string, def ...interface{}) []int {
return r.GetRequestVar(key, def...).Ints() return r.GetRequestVar(key, def...).Ints()
} }
@ -75,6 +83,14 @@ func (r *Request) GetRequestUint(key string, def ...interface{}) uint {
return r.GetRequestVar(key, def...).Uint() return r.GetRequestVar(key, def...).Uint()
} }
func (r *Request) GetRequestUint32(key string, def ...interface{}) uint32 {
return r.GetRequestVar(key, def...).Uint32()
}
func (r *Request) GetRequestUint64(key string, def ...interface{}) uint64 {
return r.GetRequestVar(key, def...).Uint64()
}
func (r *Request) GetRequestFloat32(key string, def ...interface{}) float32 { func (r *Request) GetRequestFloat32(key string, def ...interface{}) float32 {
return r.GetRequestVar(key, def...).Float32() return r.GetRequestVar(key, def...).Float32()
} }