Commit 44f5c208 authored by astaxie's avatar astaxie

update example

parent 83e26fdc
......@@ -12,7 +12,7 @@ type ObjectController struct {
func (this *ObjectController) Post() {
var ob models.Object
json.Unmarshal(this.Ctx.RequestBody, &ob)
json.Unmarshal(this.Ctx.Input.RequestBody, &ob)
objectid := models.AddOne(ob)
this.Data["json"] = map[string]string{"ObjectId": objectid}
this.ServeJson()
......@@ -37,7 +37,7 @@ func (this *ObjectController) Get() {
func (this *ObjectController) Put() {
objectId := this.Ctx.Params[":objectId"]
var ob models.Object
json.Unmarshal(this.Ctx.RequestBody, &ob)
json.Unmarshal(this.Ctx.Input.RequestBody, &ob)
err := models.Update(objectId, ob.Score)
if err != nil {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment