mirror of
https://github.com/astaxie/beego.git
synced 2024-12-23 00:00:50 +00:00
Changed ObejctController to ObjectController
This commit is contained in:
parent
f92973794e
commit
56a1603e1f
@ -6,11 +6,11 @@ import (
|
||||
"github.com/astaxie/beego/example/beeapi/models"
|
||||
)
|
||||
|
||||
type ObejctController struct {
|
||||
type ObjectController struct {
|
||||
beego.Controller
|
||||
}
|
||||
|
||||
func (this *ObejctController) Post() {
|
||||
func (this *ObjectController) Post() {
|
||||
var ob models.Object
|
||||
json.Unmarshal(this.Ctx.RequestBody, &ob)
|
||||
objectid := models.AddOne(ob)
|
||||
@ -18,7 +18,7 @@ func (this *ObejctController) Post() {
|
||||
this.ServeJson()
|
||||
}
|
||||
|
||||
func (this *ObejctController) Get() {
|
||||
func (this *ObjectController) Get() {
|
||||
objectId := this.Ctx.Params[":objectId"]
|
||||
if objectId != "" {
|
||||
ob, err := models.GetOne(objectId)
|
||||
@ -34,7 +34,7 @@ func (this *ObejctController) Get() {
|
||||
this.ServeJson()
|
||||
}
|
||||
|
||||
func (this *ObejctController) Put() {
|
||||
func (this *ObjectController) Put() {
|
||||
objectId := this.Ctx.Params[":objectId"]
|
||||
var ob models.Object
|
||||
json.Unmarshal(this.Ctx.RequestBody, &ob)
|
||||
@ -48,7 +48,7 @@ func (this *ObejctController) Put() {
|
||||
this.ServeJson()
|
||||
}
|
||||
|
||||
func (this *ObejctController) Delete() {
|
||||
func (this *ObjectController) Delete() {
|
||||
objectId := this.Ctx.Params[":objectId"]
|
||||
models.Delete(objectId)
|
||||
this.Data["json"] = "delete success!"
|
||||
|
Loading…
Reference in New Issue
Block a user