router.go
946 字节
package routers
import (
"github.com/astaxie/beego"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr/controllers"
"gitlab.fjmaimaimai.com/mmm-go/partner/pkg/port/appsvr/middleware"
)
func init() {
nsV1 := beego.NewNamespace("v1", beego.NSBefore(middleware.CheckJWTToken))//beego.NSNamespace("auth", beego.NSInclude(&controllers.AuthController{})),
nsV1.Router("auth/login", &controllers.AuthController{}, "Post:Login")
nsV1.Router("auth/smsCode", &controllers.AuthController{}, "Post:SmsCode")
nsV1.Router("auth/accessToken", &controllers.AuthController{}, "Post:AccessToken")
nsV1.Router("auth/refreshToken", &controllers.AuthController{}, "Post:RefreshToken")
nsV1.Router("auth/revoke", &controllers.AuthController{}, "Post:Revoke")
nsV1.Router("auth/updateDevice", &controllers.AuthController{}, "Post:UpdateDevice")
nsV1.Router("user/userInfo", &controllers.UserController{}, "Post:UserInfo")
beego.AddNamespace(nsV1)
}