mirror of
https://github.com/beego/bee.git
synced 2024-11-25 20:10:55 +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"
|
||||||
"github.com/astaxie/beego/swagger"
|
"github.com/astaxie/beego/swagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
Rootinfo string = {{.rootinfo}}
|
Rootinfo string = {{.rootinfo}}
|
||||||
Subapi string = {{.subapi}}
|
Subapi string = {{.subapi}}
|
||||||
|
BasePath string= "{{.version}}"
|
||||||
)
|
)
|
||||||
|
|
||||||
var rootapi swagger.ResourceListing
|
var rootapi swagger.ResourceListing
|
||||||
|
|
||||||
var apilist map[string]*swagger.ApiDeclaration
|
var apilist map[string]*swagger.ApiDeclaration
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
basepath := "{{.version}}"
|
|
||||||
err := json.Unmarshal([]byte(Rootinfo), &rootapi)
|
err := json.Unmarshal([]byte(Rootinfo), &rootapi)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
beego.Error(err)
|
beego.Error(err)
|
||||||
@ -69,7 +69,7 @@ func init() {
|
|||||||
a.Path = urlReplace(k + a.Path)
|
a.Path = urlReplace(k + a.Path)
|
||||||
v.Apis[i] = a
|
v.Apis[i] = a
|
||||||
}
|
}
|
||||||
v.BasePath = basepath
|
v.BasePath = BasePath
|
||||||
beego.GlobalDocApi[strings.Trim(k, "/")] = v
|
beego.GlobalDocApi[strings.Trim(k, "/")] = v
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user