9ccdb310 by astaxie

fix #236

1 parent 0adb8642
...@@ -19,7 +19,7 @@ func (this *ObjectController) Post() { ...@@ -19,7 +19,7 @@ func (this *ObjectController) Post() {
19 } 19 }
20 20
21 func (this *ObjectController) Get() { 21 func (this *ObjectController) Get() {
22 objectId := this.Ctx.Params[":objectId"] 22 objectId := this.Ctx.Input.Param[":objectId"]
23 if objectId != "" { 23 if objectId != "" {
24 ob, err := models.GetOne(objectId) 24 ob, err := models.GetOne(objectId)
25 if err != nil { 25 if err != nil {
...@@ -35,7 +35,7 @@ func (this *ObjectController) Get() { ...@@ -35,7 +35,7 @@ func (this *ObjectController) Get() {
35 } 35 }
36 36
37 func (this *ObjectController) Put() { 37 func (this *ObjectController) Put() {
38 objectId := this.Ctx.Params[":objectId"] 38 objectId := this.Ctx.Input.Param[":objectId"]
39 var ob models.Object 39 var ob models.Object
40 json.Unmarshal(this.Ctx.Input.RequestBody, &ob) 40 json.Unmarshal(this.Ctx.Input.RequestBody, &ob)
41 41
...@@ -49,7 +49,7 @@ func (this *ObjectController) Put() { ...@@ -49,7 +49,7 @@ func (this *ObjectController) Put() {
49 } 49 }
50 50
51 func (this *ObjectController) Delete() { 51 func (this *ObjectController) Delete() {
52 objectId := this.Ctx.Params[":objectId"] 52 objectId := this.Ctx.Input.Param[":objectId"]
53 models.Delete(objectId) 53 models.Delete(objectId)
54 this.Data["json"] = "delete success!" 54 this.Data["json"] = "delete success!"
55 this.ServeJson() 55 this.ServeJson()
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!