From 856d3424d6c059fb0ea07a545cc5e3d0e1b3fe4d Mon Sep 17 00:00:00 2001 From: John Date: Mon, 30 Apr 2018 08:37:20 +0800 Subject: [PATCH] =?UTF-8?q?ghttp.Server=E4=BA=8B=E4=BB=B6=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E4=B9=8B=E9=97=B4=E6=94=AF=E6=8C=81=E9=80=9A=E8=BF=87?= =?UTF-8?q?ghttp.Request.Param=E8=87=AA=E5=AE=9A=E4=B9=89=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=BF=9B=E8=A1=8C=E6=B5=81=E7=A8=8B=E4=BC=A0=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 2 +- TODO | 12 ++++++------ g/net/ghttp/http_request.go | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.MD b/README.MD index f5ba62c0b..13209ee1a 100644 --- a/README.MD +++ b/README.MD @@ -65,7 +65,7 @@ gf是一款模块化、松耦合、轻量级、高性能的Web开发框架。开 * [ORM链式操作](http://gf.johng.cn/596224) * [ORM方法操作](http://gf.johng.cn/596223) * [ORM事务操作](http://gf.johng.cn/596225) - * [ORM高级用法](http://gf.johng.cn/606435) + * [ORM高级特性](http://gf.johng.cn/606435) * [框架开发进阶](http://gf.johng.cn/598801) * [HTTPS服务](http://gf.johng.cn/598802) * [服务性能分析](http://gf.johng.cn/592298) diff --git a/TODO b/TODO index ce6f085b2..0211dedf0 100644 --- a/TODO +++ b/TODO @@ -4,11 +4,7 @@ ON THE WAY: 3. 更多数据库的ORM功能支持; 4. 验证码包支持; 5. FAQ -6. ghttp.Server多个时间之间如何传参?Request?Context? -7. ghttp.Server日志中增加请求时间和返回时间,以便计算执行时间差; -8. 由于去掉了gdb的单例模式,并且将gins的部分对象封装迁移到了g包中,需要同时梳理文档,完善修改; -9. 在代码中增加https与http同时开启使用的示例代码,这块大家问得比较多; -10. gdb对象管理增加二级连接池特性; +6. gdb对象管理增加二级连接池特性; DONE: 1. gconv完善针对不同类型的判断,例如:尽量减少sprintf("%v", xxx)来执行string类型的转换; @@ -21,4 +17,8 @@ DONE: 8. 跟踪第三方mxj包的issue问题:https://github.com/clbanning/mxj/issues/48; 9. gdb Where方法参数的改进,研究是否可以将string参数类型修改为interface{}; 10. gpage分页控制功能; -11. https支持; \ No newline at end of file +11. https支持; +12. ghttp.Server日志中增加请求时间和返回时间,以便计算执行时间差; +13. 由于去掉了gdb的单例模式,并且将gins的部分对象封装迁移到了g包中,需要同时梳理文档,完善修改; +14. 在代码中增加https与http同时开启使用的示例代码,这块大家问得比较多; +15. ghttp.Server多个事件之间通过ghttp.Request.Param自定义参数传参; \ No newline at end of file diff --git a/g/net/ghttp/http_request.go b/g/net/ghttp/http_request.go index 022f444c2..8a48013aa 100644 --- a/g/net/ghttp/http_request.go +++ b/g/net/ghttp/http_request.go @@ -31,6 +31,7 @@ type Request struct { Router *Router // 匹配到的路由对象 EnterTime int64 // 请求进入时间(微秒) LeaveTime int64 // 请求完成时间(微秒) + Param interface{} // 开发者自定义参数 } // 创建一个Request对象