This commit is contained in:
john
2018-08-17 18:21:10 +08:00
parent 403f1d9ad8
commit a307a532d0
2 changed files with 30 additions and 0 deletions

2
TODO
View File

@ -17,6 +17,8 @@ gfsnotify增加对于目录的监控
orm增加sqlite对Save方法的支持(去掉触发器语句);
ghttp.Server的Cookie及Session锁机制优化(去掉map锁机制);
ghttp.Server增加Ip访问控制功能(DenyIps&AllowIps)
ghttp路由功能增加分组路由特性
DONE:
1. gconv完善针对不同类型的判断例如尽量减少sprintf("%v", xxx)来执行string类型的转换

View File

@ -95,6 +95,34 @@ func (r *Request) GetJson() *gjson.Json {
return nil
}
func (r *Request) GetString(k string) string {
return r.GetRequestString(k)
}
func (r *Request) GetInt(k string) int {
return r.GetRequestInt(k)
}
func (r *Request) GetUint(k string) uint {
return r.GetRequestUint(k)
}
func (r *Request) GetFloat32(k string) float32 {
return r.GetRequestFloat32(k)
}
func (r *Request) GetFloat64(k string) float64 {
return r.GetRequestFloat64(k)
}
func (r *Request) GetArray(k string) []string {
return r.GetRequestArray(k)
}
func (r *Request) GetMap(defaultMap...map[string]string) map[string]string {
return r.GetRequestMap(defaultMap...)
}
// 将所有的request参数映射到struct属性上参数object应当为一个struct对象的指针, mapping为非必需参数自定义参数与属性的映射关系
func (r *Request) GetToStruct(object interface{}, mapping...map[string]string) {
r.GetRequestToStruct(object, mapping...)