Files
jx-callback/routers/router.go
suyl bfe94e735a aa
2021-06-24 16:09:02 +08:00

43 lines
1.0 KiB
Go

// @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("/v2",
web.NSNamespace("/openapi"),
web.NSNamespace("/print",
web.NSInclude(
&controllers.PrintController{},
),
),
web.NSNamespace("/task",
web.NSInclude(
&controllers.TaskController{},
),
),
)
web.AddNamespace(ns)
// 如下都是用于检测存活的空接口
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")
})
}