mirror of
https://github.com/beego/bee.git
synced 2024-12-22 20:20:49 +00:00
补上BasePath
还有个根路径
This commit is contained in:
parent
06e5d94806
commit
e47516cd15
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user