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
56032c67
Commit
56032c67
authored
Sep 18, 2015
by
JessonChan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
runFunction camel name
parent
40cb8e0c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
router.go
router.go
+3
-3
No files found.
router.go
View file @
56032c67
...
...
@@ -109,7 +109,7 @@ type controllerInfo struct {
controllerType
reflect
.
Type
methods
map
[
string
]
string
handler
http
.
Handler
run
function
FilterFunc
run
Function
FilterFunc
routerType
int
}
...
...
@@ -325,7 +325,7 @@ func (p *ControllerRegister) AddMethod(method, pattern string, f FilterFunc) {
route
:=
&
controllerInfo
{}
route
.
pattern
=
pattern
route
.
routerType
=
routerTypeRESTFul
route
.
run
f
unction
=
f
route
.
run
F
unction
=
f
methods
:=
make
(
map
[
string
]
string
)
if
method
==
"*"
{
for
_
,
val
:=
range
HTTPMETHOD
{
...
...
@@ -726,7 +726,7 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
if
routerInfo
.
routerType
==
routerTypeRESTFul
{
if
_
,
ok
:=
routerInfo
.
methods
[
r
.
Method
];
ok
{
isRunable
=
true
routerInfo
.
run
f
unction
(
context
)
routerInfo
.
run
F
unction
(
context
)
}
else
{
exception
(
"405"
,
context
)
goto
Admin
...
...
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