From e71da492dfc4f3ad314fba419f10243196444529 Mon Sep 17 00:00:00 2001 From: "limingjian110@163.com" Date: Fri, 27 Nov 2015 16:49:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E5=B0=8F=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- zh/13.5.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zh/13.5.md b/zh/13.5.md index 62fbcbe4..53fdd17e 100644 --- a/zh/13.5.md +++ b/zh/13.5.md @@ -67,7 +67,7 @@ ViewController: } func (this *ViewController) Get() { - id, _ := strconv.Atoi(this.Ctx.Input.Params(":id")) + id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" this.TplNames = "view.tpl" @@ -104,7 +104,7 @@ EditController id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" - this.TplNames = "new.tpl" + this.TplNames = "edit.tpl" } func (this *EditController) Post() { @@ -125,8 +125,8 @@ DeleteController } func (this *DeleteController) Get() { - id, _ := strconv.Atoi(this.Ctx.Input.Params(":id")) - blog := GetBlog(id int) + id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) + blog := models.GetBlog(id int) this.Data["Post"] = blog models.DelBlog(blog) this.Ctx.Redirect(302, "/") From e3a38152f29f2c924ea07716337910ba40eabb64 Mon Sep 17 00:00:00 2001 From: "limingjian110@163.com" Date: Fri, 27 Nov 2015 17:02:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B0=8F=E7=BA=A0?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de/13.5.md | 10 ++++++---- ja/13.5.md | 8 ++++---- pt-br/13.5.md | 6 ++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/de/13.5.md b/de/13.5.md index fa086c64..3f544075 100644 --- a/de/13.5.md +++ b/de/13.5.md @@ -127,7 +127,7 @@ func (this *EditController) Get() { id, _ := strconv.Atoi(this.Ctx.Params[":id"]) this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" - this.TplNames = "new.tpl" + this.TplNames = "edit.tpl" } func (this *EditController) Post() { @@ -150,9 +150,11 @@ type DeleteController struct { } func (this *DeleteController) Get() { - id, _ := strconv.Atoi(this.Ctx.Params[":id"]) - this.Data["Post"] = models.DelBlog(id) - this.Ctx.Redirect(302, "/") + id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) + blog := models.GetBlog(id int) + this.Data["Post"] = blog + models.DelBlog(blog) + this.Ctx.Redirect(302, "/") } ``` diff --git a/ja/13.5.md b/ja/13.5.md index 66616a4d..b465aee8 100644 --- a/ja/13.5.md +++ b/ja/13.5.md @@ -66,7 +66,7 @@ ViewController: } func (this *ViewController) Get() { - id, _ := strconv.Atoi(this.Ctx.Input.Params(":id")) + id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" this.TplNames = "view.tpl" @@ -103,7 +103,7 @@ EditController id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" - this.TplNames = "new.tpl" + this.TplNames = "edit.tpl" } func (this *EditController) Post() { @@ -124,8 +124,8 @@ DeleteController } func (this *DeleteController) Get() { - id, _ := strconv.Atoi(this.Ctx.Input.Params(":id")) - blog := GetBlog(id int) + id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) + blog := models.GetBlog(id) this.Data["Post"] = blog models.DelBlog(blog) this.Ctx.Redirect(302, "/") diff --git a/pt-br/13.5.md b/pt-br/13.5.md index fa086c64..5ee6f238 100644 --- a/pt-br/13.5.md +++ b/pt-br/13.5.md @@ -127,7 +127,7 @@ func (this *EditController) Get() { id, _ := strconv.Atoi(this.Ctx.Params[":id"]) this.Data["Post"] = models.GetBlog(id) this.Layout = "layout.tpl" - this.TplNames = "new.tpl" + this.TplNames = "edit.tpl" } func (this *EditController) Post() { @@ -151,7 +151,9 @@ type DeleteController struct { func (this *DeleteController) Get() { id, _ := strconv.Atoi(this.Ctx.Params[":id"]) - this.Data["Post"] = models.DelBlog(id) + blog := models.GetBlog(id) + this.Data["Post"] = blog + models.DelBlog(blog) this.Ctx.Redirect(302, "/") } ``` From 70c673aa6799866824c3c8df030a127f13195f0b Mon Sep 17 00:00:00 2001 From: nivance Date: Sat, 28 Nov 2015 14:13:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=B0=8F=E7=BA=A0?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- de/13.5.md | 2 +- zh/13.5.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/de/13.5.md b/de/13.5.md index 3f544075..e011b8b0 100644 --- a/de/13.5.md +++ b/de/13.5.md @@ -151,7 +151,7 @@ type DeleteController struct { func (this *DeleteController) Get() { id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) - blog := models.GetBlog(id int) + blog := models.GetBlog(id) this.Data["Post"] = blog models.DelBlog(blog) this.Ctx.Redirect(302, "/") diff --git a/zh/13.5.md b/zh/13.5.md index 53fdd17e..803041ce 100644 --- a/zh/13.5.md +++ b/zh/13.5.md @@ -126,7 +126,7 @@ DeleteController func (this *DeleteController) Get() { id, _ := strconv.Atoi(this.Ctx.Input.Params[":id"]) - blog := models.GetBlog(id int) + blog := models.GetBlog(id) this.Data["Post"] = blog models.DelBlog(blog) this.Ctx.Redirect(302, "/")