mirror of
https://github.com/beego/bee.git
synced 2024-11-22 10:10:53 +00:00
commit
0f0a217752
16
g_docs.go
16
g_docs.go
@ -45,19 +45,21 @@ import (
|
|||||||
"github.com/astaxie/beego/swagger"
|
"github.com/astaxie/beego/swagger"
|
||||||
)
|
)
|
||||||
|
|
||||||
var rootinfo string = {{.rootinfo}}
|
const (
|
||||||
var subapi string = {{.subapi}}
|
Rootinfo string = {{.rootinfo}}
|
||||||
var rootapi swagger.ResourceListing
|
Subapi string = {{.subapi}}
|
||||||
|
BasePath string= "{{.version}}"
|
||||||
|
)
|
||||||
|
|
||||||
|
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)
|
||||||
}
|
}
|
||||||
err = json.Unmarshal([]byte(subapi), &apilist)
|
err = json.Unmarshal([]byte(Subapi), &apilist)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
beego.Error(err)
|
beego.Error(err)
|
||||||
}
|
}
|
||||||
@ -67,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