Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
aaf1490f
authored
2013-09-28 23:37:05 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix router
1 parent
a62ed10a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
3 deletions
controller.go
router.go
controller.go
View file @
aaf1490
...
...
@@ -36,7 +36,7 @@ type Controller struct {
}
type
ControllerInterface
interface
{
Init
(
ct
*
context
.
Context
,
childName
string
)
Init
(
ct
*
context
.
Context
,
childName
string
,
app
interface
{}
)
Prepare
()
Get
()
Post
()
...
...
router.go
View file @
aaf1490
...
...
@@ -445,7 +445,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
//call the controller init function
method
:=
vc
.
MethodByName
(
"Init"
)
in
:=
make
([]
reflect
.
Value
,
2
)
in
:=
make
([]
reflect
.
Value
,
3
)
in
[
0
]
=
reflect
.
ValueOf
(
context
)
in
[
1
]
=
reflect
.
ValueOf
(
runrouter
.
controllerType
.
Name
())
in
[
2
]
=
reflect
.
ValueOf
(
vc
.
Interface
())
...
...
@@ -653,9 +653,10 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
//call the controller init function
init
:=
vc
.
MethodByName
(
"Init"
)
in
:=
make
([]
reflect
.
Value
,
2
)
in
:=
make
([]
reflect
.
Value
,
3
)
in
[
0
]
=
reflect
.
ValueOf
(
context
)
in
[
1
]
=
reflect
.
ValueOf
(
controllerType
.
Name
())
in
[
2
]
=
reflect
.
ValueOf
(
vc
.
Interface
())
init
.
Call
(
in
)
//call prepare function
in
=
make
([]
reflect
.
Value
,
0
)
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment