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