From 3114e6153702dfdef8f0027dd76c055d9558f068 Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 10 Dec 2013 10:00:17 +0800 Subject: [PATCH] fix param to params --- apiapp.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apiapp.go b/apiapp.go index f3038fa..87ade63 100644 --- a/apiapp.go +++ b/apiapp.go @@ -150,7 +150,7 @@ func (this *ObjectController) Post() { } func (this *ObjectController) Get() { - objectId := this.Ctx.Input.Param[":objectId"] + objectId := this.Ctx.Input.Params[":objectId"] if objectId != "" { ob, err := models.GetOne(objectId) if err != nil { @@ -166,7 +166,7 @@ func (this *ObjectController) Get() { } func (this *ObjectController) Put() { - objectId := this.Ctx.Input.Param[":objectId"] + objectId := this.Ctx.Input.Params[":objectId"] var ob models.Object json.Unmarshal(this.Ctx.Input.RequestBody, &ob) @@ -180,7 +180,7 @@ func (this *ObjectController) Put() { } func (this *ObjectController) Delete() { - objectId := this.Ctx.Input.Param[":objectId"] + objectId := this.Ctx.Input.Params[":objectId"] models.Delete(objectId) this.Data["json"] = "delete success!" this.ServeJson()