// @APIVersion 1.0.0 // @Title web Test API // @Description web has a very cool tools to autogenerate documents for your API // @Contact astaxie@gmail.com // @TermsOfServiceUrl http://web.me/ // @License Apache 2.0 // @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html package routers import ( "git.rosy.net.cn/jx-callback/controllers" "github.com/astaxie/beego/server/web" beecontext "github.com/astaxie/beego/server/web/context" ) func init() { ns := web.NewNamespace("/openapi", web.NSInclude( &controllers.ApiController{}, ), ) ns2 := web.NewNamespace("/v2", web.NSNamespace("/task", web.NSInclude( &controllers.TaskController{}, ), ), web.NSNamespace("/auth", web.NSInclude( &controllers.AuthController{}, ), ), ) web.AddNamespace(ns) web.AddNamespace(ns2) // 如下都是用于检测存活的空接口 web.Any("/", func(ctx *beecontext.Context) { ctx.WriteString("pong\n") }) web.Any("/res", func(ctx *beecontext.Context) { ctx.WriteString("pong\n") }) web.Any("/addstoremsg", func(ctx *beecontext.Context) { ctx.WriteString("pong\n") }) }