Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
b96f7e2e
Commit
b96f7e2e
authored
Aug 28, 2013
by
astaxie
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #174 from Xelom/FixBra
Changed ObejctController to ObjectController in beeapi
parents
f9297379
cde38fbe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
default.go
example/beeapi/controllers/default.go
+5
-5
main.go
example/beeapi/main.go
+1
-1
No files found.
example/beeapi/controllers/default.go
View file @
b96f7e2e
...
...
@@ -6,11 +6,11 @@ import (
"github.com/astaxie/beego/example/beeapi/models"
)
type
Ob
ej
ctController
struct
{
type
Ob
je
ctController
struct
{
beego
.
Controller
}
func
(
this
*
Ob
ej
ctController
)
Post
()
{
func
(
this
*
Ob
je
ctController
)
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
*
Ob
ej
ctController
)
Get
()
{
func
(
this
*
Ob
je
ctController
)
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
*
Ob
ej
ctController
)
Put
()
{
func
(
this
*
Ob
je
ctController
)
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
*
Ob
ej
ctController
)
Delete
()
{
func
(
this
*
Ob
je
ctController
)
Delete
()
{
objectId
:=
this
.
Ctx
.
Params
[
":objectId"
]
models
.
Delete
(
objectId
)
this
.
Data
[
"json"
]
=
"delete success!"
...
...
example/beeapi/main.go
View file @
b96f7e2e
...
...
@@ -15,6 +15,6 @@ import (
// /object/<objectId> DELETE Deleting Objects
func
main
()
{
beego
.
RESTRouter
(
"/object"
,
&
controllers
.
Ob
ej
ctController
{})
beego
.
RESTRouter
(
"/object"
,
&
controllers
.
Ob
je
ctController
{})
beego
.
Run
()
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment