router.go
313 字节
package routers
import (
"oppmg/controllers"
"oppmg/middleware"
"github.com/astaxie/beego"
)
func init() {
nsAuth := beego.NewNamespace("/auth",
beego.NSBefore(middleware.AuthToken),
beego.NSRouter("/accessToken", &controllers.AuthController{}, "post:AccessToken"),
)
beego.AddNamespace(nsAuth)
}