1
0
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:
砼砼 2014-11-20 01:17:43 +08:00
parent 976602bc01
commit 06e5d94806

View File

@ -44,20 +44,22 @@ import (
"github.com/astaxie/beego"
"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 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)
}