[TOC] 自动路由 ``` //配置路由 beego.Router("/api/client/user_info", &controllers.UserInfoController{}, "get,post:ApiFunc") //直接自动路由,路由为 /controller/action beego.AutoRouter(&controllers.DemoController{}), //在命名空间下自动设置路由 ns := beego.NewNamespace("/api", beego.NSAutoRouter(&controllers.DemoController{}), ) beego.AddNamespace(ns) ```