From ad34b7be2a3dbbaa1ab6d113cea86ad022ba89bf Mon Sep 17 00:00:00 2001 From: ZetaChow Date: Fri, 9 Sep 2016 15:20:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=87=BD=E6=95=B0=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=EF=BC=8C=E4=BB=A5=E7=AC=A6=E5=90=88Lint=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- g_appcode.go | 8 +++++++- g_controllers.go | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/g_appcode.go b/g_appcode.go index 76d78ad..5d44663 100644 --- a/g_appcode.go +++ b/g_appcode.go @@ -1168,11 +1168,12 @@ import ( "github.com/astaxie/beego" ) -// oprations for {{ctrlName}} +// {{ctrlName}}Controller oprations for {{ctrlName}} type {{ctrlName}}Controller struct { beego.Controller } +// URLMapping ... func (c *{{ctrlName}}Controller) URLMapping() { c.Mapping("Post", c.Post) c.Mapping("GetOne", c.GetOne) @@ -1181,6 +1182,7 @@ func (c *{{ctrlName}}Controller) URLMapping() { c.Mapping("Delete", c.Delete) } +// Post ... // @Title Post // @Description create {{ctrlName}} // @Param body body models.{{ctrlName}} true "body for {{ctrlName}} content" @@ -1202,6 +1204,7 @@ func (c *{{ctrlName}}Controller) Post() { c.ServeJSON() } +// Get ... // @Title Get // @Description get {{ctrlName}} by id // @Param id path string true "The key for staticblock" @@ -1220,6 +1223,7 @@ func (c *{{ctrlName}}Controller) GetOne() { c.ServeJSON() } +// GetAll ... // @Title Get All // @Description get {{ctrlName}} // @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @@ -1282,6 +1286,7 @@ func (c *{{ctrlName}}Controller) GetAll() { c.ServeJSON() } +// Update ... // @Title Update // @Description update the {{ctrlName}} // @Param id path string true "The id you want to update" @@ -1305,6 +1310,7 @@ func (c *{{ctrlName}}Controller) Put() { c.ServeJSON() } +// Delete ... // @Title Delete // @Description delete the {{ctrlName}} // @Param id path string true "The id you want to delete" diff --git a/g_controllers.go b/g_controllers.go index 79ed554..15ab0bd 100644 --- a/g_controllers.go +++ b/g_controllers.go @@ -82,11 +82,12 @@ import ( "github.com/astaxie/beego" ) -// operations for {{controllerName}} +// {{controllerName}}Controller operations for {{controllerName}} type {{controllerName}}Controller struct { beego.Controller } +// URLMapping ... func (c *{{controllerName}}Controller) URLMapping() { c.Mapping("Post", c.Post) c.Mapping("GetOne", c.GetOne) @@ -95,6 +96,7 @@ func (c *{{controllerName}}Controller) URLMapping() { c.Mapping("Delete", c.Delete) } +// Post ... // @Title Create // @Description create {{controllerName}} // @Param body body models.{{controllerName}} true "body for {{controllerName}} content" @@ -105,6 +107,7 @@ func (c *{{controllerName}}Controller) Post() { } +// GetOne ... // @Title GetOne // @Description get {{controllerName}} by id // @Param id path string true "The key for staticblock" @@ -115,6 +118,7 @@ func (c *{{controllerName}}Controller) GetOne() { } +// GetAll ... // @Title GetAll // @Description get {{controllerName}} // @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @@ -130,6 +134,7 @@ func (c *{{controllerName}}Controller) GetAll() { } +// Update ... // @Title Update // @Description update the {{controllerName}} // @Param id path string true "The id you want to update" @@ -141,6 +146,7 @@ func (c *{{controllerName}}Controller) Put() { } +// Delete ... // @Title Delete // @Description delete the {{controllerName}} // @Param id path string true "The id you want to delete" @@ -164,11 +170,12 @@ import ( "github.com/astaxie/beego" ) -// oprations for {{controllerName}} +// {{controllerName}}Controller oprations for {{controllerName}} type {{controllerName}}Controller struct { beego.Controller } +// URLMapping ... func (c *{{controllerName}}Controller) URLMapping() { c.Mapping("Post", c.Post) c.Mapping("GetOne", c.GetOne) @@ -177,6 +184,7 @@ func (c *{{controllerName}}Controller) URLMapping() { c.Mapping("Delete", c.Delete) } +// Post ... // @Title Post // @Description create {{controllerName}} // @Param body body models.{{controllerName}} true "body for {{controllerName}} content" @@ -195,6 +203,7 @@ func (c *{{controllerName}}Controller) Post() { c.ServeJSON() } +// Get ... // @Title Get // @Description get {{controllerName}} by id // @Param id path string true "The key for staticblock" @@ -213,6 +222,7 @@ func (c *{{controllerName}}Controller) GetOne() { c.ServeJSON() } +// GetAll ... // @Title Get All // @Description get {{controllerName}} // @Param query query string false "Filter. e.g. col1:v1,col2:v2 ..." @@ -275,6 +285,7 @@ func (c *{{controllerName}}Controller) GetAll() { c.ServeJSON() } +// Update ... // @Title Update // @Description update the {{controllerName}} // @Param id path string true "The id you want to update" @@ -295,6 +306,7 @@ func (c *{{controllerName}}Controller) Put() { c.ServeJSON() } +// Delete ... // @Title Delete // @Description delete the {{controllerName}} // @Param id path string true "The id you want to delete"