mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 19:10:54 +00:00
fix #236
This commit is contained in:
parent
0adb864219
commit
9ccdb31003
@ -19,7 +19,7 @@ func (this *ObjectController) Post() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *ObjectController) Get() {
|
func (this *ObjectController) Get() {
|
||||||
objectId := this.Ctx.Params[":objectId"]
|
objectId := this.Ctx.Input.Param[":objectId"]
|
||||||
if objectId != "" {
|
if objectId != "" {
|
||||||
ob, err := models.GetOne(objectId)
|
ob, err := models.GetOne(objectId)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -35,7 +35,7 @@ func (this *ObjectController) Get() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *ObjectController) Put() {
|
func (this *ObjectController) Put() {
|
||||||
objectId := this.Ctx.Params[":objectId"]
|
objectId := this.Ctx.Input.Param[":objectId"]
|
||||||
var ob models.Object
|
var ob models.Object
|
||||||
json.Unmarshal(this.Ctx.Input.RequestBody, &ob)
|
json.Unmarshal(this.Ctx.Input.RequestBody, &ob)
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ func (this *ObjectController) Put() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *ObjectController) Delete() {
|
func (this *ObjectController) Delete() {
|
||||||
objectId := this.Ctx.Params[":objectId"]
|
objectId := this.Ctx.Input.Param[":objectId"]
|
||||||
models.Delete(objectId)
|
models.Delete(objectId)
|
||||||
this.Data["json"] = "delete success!"
|
this.Data["json"] = "delete success!"
|
||||||
this.ServeJson()
|
this.ServeJson()
|
||||||
|
Loading…
Reference in New Issue
Block a user