From 550bb2d72cfd4825429cb2e6d8b17e073e522c21 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 17 Apr 2018 16:16:53 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=9C=8D=E5=8A=A1=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E6=97=B6=E6=96=B9=E6=B3=95=E5=90=8D=E5=B8=A6=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E5=8D=95=E8=AF=8D=E7=9A=84=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- geg/frame/mvc/controller/demo/user.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/geg/frame/mvc/controller/demo/user.go b/geg/frame/mvc/controller/demo/user.go index 578699def..31502096f 100644 --- a/geg/frame/mvc/controller/demo/user.go +++ b/geg/frame/mvc/controller/demo/user.go @@ -17,6 +17,7 @@ func init() { // 例如该方法执行后,查看效果可访问: // http://127.0.0.1:8199/user/name // http://127.0.0.1:8199/user/age + // http://127.0.0.1:8199/user/true-name ghttp.GetServer().BindController("/user", &ControllerUser{}) } @@ -30,5 +31,10 @@ func (c *ControllerUser) Age() { c.Response.Write("18") } +// 定义操作逻辑 - 展示方法名称如果带多个单词,路由控制器使用英文连接符号"-"进行拼接 +func (c *ControllerUser) TrueName() { + c.Response.Write("John Smith") +} +