mirror of
https://github.com/beego/bee.git
synced 2024-11-22 15:10:54 +00:00
添加常量Rootinfo和Subapi
修改rootinfo和subapi,为常量并为可导出
This commit is contained in:
parent
976602bc01
commit
06e5d94806
10
g_docs.go
10
g_docs.go
@ -44,20 +44,22 @@ import (
|
|||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
"github.com/astaxie/beego/swagger"
|
"github.com/astaxie/beego/swagger"
|
||||||
)
|
)
|
||||||
|
const (
|
||||||
|
Rootinfo string = {{.rootinfo}}
|
||||||
|
Subapi string = {{.subapi}}
|
||||||
|
)
|
||||||
|
|
||||||
var rootinfo string = {{.rootinfo}}
|
|
||||||
var subapi string = {{.subapi}}
|
|
||||||
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}}"
|
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)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user