fix #236
Showing
1 changed file
with
3 additions
and
3 deletions
| ... | @@ -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() | ... | ... |
-
Please register or sign in to post a comment