mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 12:00:55 +00:00
runFunction camel name
This commit is contained in:
parent
40cb8e0cf1
commit
56032c67af
@ -109,7 +109,7 @@ type controllerInfo struct {
|
|||||||
controllerType reflect.Type
|
controllerType reflect.Type
|
||||||
methods map[string]string
|
methods map[string]string
|
||||||
handler http.Handler
|
handler http.Handler
|
||||||
runfunction FilterFunc
|
runFunction FilterFunc
|
||||||
routerType int
|
routerType int
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,7 +325,7 @@ func (p *ControllerRegister) AddMethod(method, pattern string, f FilterFunc) {
|
|||||||
route := &controllerInfo{}
|
route := &controllerInfo{}
|
||||||
route.pattern = pattern
|
route.pattern = pattern
|
||||||
route.routerType = routerTypeRESTFul
|
route.routerType = routerTypeRESTFul
|
||||||
route.runfunction = f
|
route.runFunction = f
|
||||||
methods := make(map[string]string)
|
methods := make(map[string]string)
|
||||||
if method == "*" {
|
if method == "*" {
|
||||||
for _, val := range HTTPMETHOD {
|
for _, val := range HTTPMETHOD {
|
||||||
@ -726,7 +726,7 @@ func (p *ControllerRegister) ServeHTTP(rw http.ResponseWriter, r *http.Request)
|
|||||||
if routerInfo.routerType == routerTypeRESTFul {
|
if routerInfo.routerType == routerTypeRESTFul {
|
||||||
if _, ok := routerInfo.methods[r.Method]; ok {
|
if _, ok := routerInfo.methods[r.Method]; ok {
|
||||||
isRunable = true
|
isRunable = true
|
||||||
routerInfo.runfunction(context)
|
routerInfo.runFunction(context)
|
||||||
} else {
|
} else {
|
||||||
exception("405", context)
|
exception("405", context)
|
||||||
goto Admin
|
goto Admin
|
||||||
|
Loading…
Reference in New Issue
Block a user