router.go
561 字节
package routers
import (
"github.com/astaxie/beego"
"gitlab.fjmaimaimai.com/mmm-go/ability/controllers/v1"
)
var nsV1 *beego.Namespace
func init() {
nsV1=beego.NewNamespace("/v1")
/*user controller*/
{
user :=&v1.UserController{}
nsV1.Router("/user/login",user,"post:Login")
}
/*auth controller*/
{
auth :=&v1.AuthController{}
nsV1.Router("/auth/login",auth,"post:Login")
nsV1.Router("/auth/accessToken",auth,"post:AccessToken")
nsV1.Router("/auth/refreshToken",auth,"post:RefreshToken")
}
beego.AddNamespace(nsV1)
}