1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-03 16:40:18 +00:00

beego:AST code

This commit is contained in:
astaxie
2014-06-09 17:33:04 +08:00
parent 6c8a7f1382
commit 21cb8ea4a3
3 changed files with 116 additions and 27 deletions

View File

@ -174,7 +174,7 @@ func (p *ControllerRegistor) Include(cList ...ControllerInterface) {
if pkgpath != "" {
if _, ok := skip[pkgpath]; !ok {
skip[pkgpath] = true
parserPkg(pkgpath)
parserPkg(pkgpath, t.PkgPath())
}
}
}
@ -184,7 +184,9 @@ func (p *ControllerRegistor) Include(cList ...ControllerInterface) {
t := reflect.Indirect(reflectVal).Type()
key := t.PkgPath() + ":" + t.Name()
if comm, ok := GlobalControllerRouter[key]; ok {
p.Add(comm.router, c, strings.Join(comm.allowHTTPMethods, ",")+":"+comm.method)
for _, a := range comm {
p.Add(a.router, c, strings.Join(a.allowHTTPMethods, ",")+":"+a.method)
}
}
}
}