router.go
1.3 KB
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")
nsV1.Router("user/checkSmsCode", &controllers.UserController{}, "Post:CheckSmsCode")
nsV1.Router("user/ChangePhone", &controllers.UserController{}, "Post:ChangePhone")
nsV1.Router("user/resetPassword", &controllers.UserController{}, "Post:ResetPassword")
nsV1.Router("user/changePassword", &controllers.UserController{}, "Post:ChangePassword")
beego.AddNamespace(nsV1)
}