问题描述
我尝试使用 NSNamespace 和 NSInclude 在 beego 中创建端点。
router.go
...
func Initialize() {
testNS := beego.NSNamespace("/test",beego.NSInclude(
&_mediaModControllers.TestController{},),)
ns := beego.NewNamespace("/v1",testNS,)
beego.AddNamespace(ns)
}
controller.go
...
type TestController struct {
controllers.BaseController
}
// @Title Get All
// @Description get all
// @Success 200
// @Failure 403
// @router / [get]
func (c *TestController) GetAll(limit,page int,name string) controllers.JsonResp {
return c.ReturnOK("some response")
}
但是当我尝试点击 GET localhost:8080/v1/test
但收到此日志消息时
nomatch| POST /v1/test
我做错了什么?谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)