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
56a1603e
Commit
56a1603e
authored
Aug 27, 2013
by
Arıl Bozoluk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed ObejctController to ObjectController
parent
f9297379
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
default.go
example/beeapi/controllers/default.go
+5
-5
No files found.
example/beeapi/controllers/default.go
View file @
56a1603e
...
...
@@ -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!"
...
...
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