1
0
mirror of https://github.com/beego/bee.git synced 2024-11-22 05:00:54 +00:00

补上BasePath

还有个根路径
This commit is contained in:
TossPig 2014-11-20 02:14:04 +08:00
parent 06e5d94806
commit e47516cd15

View File

@ -44,17 +44,17 @@ import (
"github.com/astaxie/beego"
"github.com/astaxie/beego/swagger"
)
const (
Rootinfo string = {{.rootinfo}}
Subapi string = {{.subapi}}
BasePath string= "{{.version}}"
)
var rootapi swagger.ResourceListing
var apilist map[string]*swagger.ApiDeclaration
func init() {
basepath := "{{.version}}"
err := json.Unmarshal([]byte(Rootinfo), &rootapi)
if err != nil {
beego.Error(err)
@ -69,7 +69,7 @@ func init() {
a.Path = urlReplace(k + a.Path)
v.Apis[i] = a
}
v.BasePath = basepath
v.BasePath = BasePath
beego.GlobalDocApi[strings.Trim(k, "/")] = v
}
}