本文整理汇总了Golang中github.com/astaxie/beego.NSRouter函数的典型用法代码示例。如果您正苦于以下问题:Golang NSRouter函数的具体用法?Golang NSRouter怎么用?Golang NSRouter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了NSRouter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Golang代码示例。
示例1: Get
// Get returns the namespace for public education
func Get() *beego.Namespace {
ns := beego.NewNamespace("education",
beego.NSRouter("", &education.Home{}, "*:Display"),
beego.NSNamespace("subjects/:subject",
beego.NSRouter("", &subject.Subject{}, "GET:Display"),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:10,代码来源:education.go
示例2: Get
// Get returns the namespace for log
func Get() func(*beego.Namespace) {
ns := beego.NSNamespace("/log",
beego.NSRouter("", &log.Home{}, "*:Display"),
getHarvest(),
beego.NSRouter("/advance-options", &log.Home{}, "*:DisplayAdvanceOptions"),
beego.NSRouter("/delete", &log.Home{}, "POST:Delete"),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:10,代码来源:log.go
示例3: Get
// Get returns the routers for the education
func Get() func(*beego.Namespace) {
subject := getSubject()
ns := beego.NSNamespace("/education",
beego.NSRouter("/analyse", &education.Home{}, "GET:Analyse"),
beego.NSRouter("/analyser/:analyser/delete", &education.Home{}, "POST:DeleteAnalyser"),
beego.NSRouter("", &education.Home{}, "*:Display"),
subject,
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:11,代码来源:education.go
示例4: Get
// Get returns the Namespace for data
func Get() func(*beego.Namespace) {
ns := beego.NSNamespace("/data/",
beego.NSNamespace("/table",
beego.NSRouter("", &data.Table{}, "GET:ShowList"),
beego.NSRouter("generate/:name", &data.Table{}, "*:Generate"),
beego.NSRouter("download/:name", &data.Table{}, "*:Download"),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:11,代码来源:table.go
示例5: getSearch
// Get returns the namespace for api
func getSearch() func(*beego.Namespace) {
ns := beego.NSNamespace("/search",
beego.NSNamespace("/anything/:query",
beego.NSRouter("", &api.Search{}, "*:SearchAnything"),
),
beego.NSNamespace("/save/:query",
beego.NSRouter("", &api.Search{}, "POST:JustSaveAccountQuery"),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:12,代码来源:search.go
示例6: Get
// Get returns the Namespace for the repositories
func Get() *beego.Namespace {
ns := beego.NewNamespace("/repositories/",
beego.NSNamespace(":repository",
beego.NSRouter("", &repository.Repository{}, "GET:Display"),
beego.NSNamespace("/resources",
beego.NSRouter("/:resource", &repository.Repository{}, "GET:DisplayResource"),
),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:12,代码来源:repository.go
示例7: Get
// Get returns the Namespace for the accounts within administration area
func Get() func(*beego.Namespace) {
ns := beego.NSNamespace("/accounts",
beego.NSRouter("", &accountsController.Home{}, "*:Display"),
beego.NSNamespace("/:account",
beego.NSNamespace("/modify",
beego.NSRouter("", &accountController.Account{}, "GET:ShowModifyForm"),
beego.NSRouter("", &accountController.Account{}, "POST:Modify"),
),
beego.NSRouter("/delete", &accountController.Account{}, "POST:Delete"),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:14,代码来源:account.go
示例8: ConfigRoutes
func ConfigRoutes() {
//owl-protal-routes
portal := beego.NewNamespace("/api/v1/portal",
beego.NSGet("/notallowed", func(ctx *context.Context) {
ctx.Output.Body([]byte("notAllowed"))
}),
beego.NSRouter("/eventcases/get", &PortalController{}, "get:EventCasesGet;post:EventCasesGet"),
beego.NSRouter("/events/get", &PortalController{}, "get:EventGet;post:EventGet"),
beego.NSRouter("/eventcases/close", &PortalController{}, "get:ColseCase;post:ColseCase;put:ColseCase"),
beego.NSRouter("/tpl/count", &PortalController{}, "get:CountNumOfTlp;post:CountNumOfTlp"),
)
beego.AddNamespace(portal)
}
开发者ID:crosserclaws,项目名称:fe,代码行数:13,代码来源:portal_routes.go
示例9: Get
// Get returns the Namespace for data
func Get() func(*beego.Namespace) {
ns := beego.NSNamespace("/tools",
beego.NSNamespace("/digester",
beego.NSRouter("", &tools.Digester{}, "GET:Display"),
beego.NSRouter("", &tools.Digester{}, "POST:Work"),
),
beego.NSNamespace("/web-digester",
beego.NSRouter("", &tools.WebDigester{}, "GET:Display"),
beego.NSRouter("", &tools.WebDigester{}, "POST:Work"),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:14,代码来源:tools.go
示例10: getHarvest
func getHarvest() func(*beego.Namespace) {
ns := beego.NSNamespace("/harvest",
beego.NSNamespace("/process/:process",
beego.NSRouter("", &process.Process{}, "*:Display"),
beego.NSNamespace("/operation/:operation",
beego.NSRouter("", &process.Operation{}, "*:Display"),
),
beego.NSRouter("/history", &process.Process{}, "*:ShowHistory"),
beego.NSRouter("/advance-options", &process.Process{}, "*:ShowAdvanceOptions"),
beego.NSRouter("/delete", &process.Process{}, "POST:Delete"),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:14,代码来源:harvest.go
示例11: getHarvest
func getHarvest() func(*beego.Namespace) {
ns := beego.NSNamespace("/harvest",
beego.NSNamespace("/init",
beego.NSRouter(":id", &admin.Harvest{}, "POST:ShowPanel"),
beego.NSRouter("/ws", &admin.Harvest{}, "GET:InitWebsocketConnection"),
),
beego.NSNamespace("/recover",
beego.NSRouter(":id", &admin.Harvest{}, "POST:RecoverProcess"),
),
beego.NSNamespace("/finish",
beego.NSRouter(":id", &admin.Harvest{}, "POST:ForceFinishProcess"),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:15,代码来源:harvest.go
示例12: Load
// Load tells the framework to load the addresses for the router
func Load() {
accountNS :=
beego.NewNamespace("/account",
beego.NSRouter("", &account.Home{}, "GET:Show"),
beego.NSNamespace("/searches/",
beego.NSRouter("", &searches.List{}, "GET:Display"),
beego.NSRouter("clear", &searches.List{}, "POST:Clear"),
),
beego.NSNamespace("/settings",
beego.NSRouter("", &settings.Settings{}, "GET:Display"),
beego.NSRouter("/delete", &settings.Settings{}, "POST:DeleteAccount"),
),
)
beego.AddNamespace(accountNS)
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:16,代码来源:account.go
示例13: getAuth
func getAuth() *beego.Namespace {
ns := beego.NewNamespace("auth",
beego.NSNamespace("/login",
beego.NSRouter("", &public.Auth{}, "GET:ShowLoginPage"),
beego.NSRouter("", &public.Auth{}, "POST:LoginAccount"),
),
beego.NSNamespace("/register",
beego.NSRouter("", &public.Auth{}, "GET:ShowRegisterForm"),
beego.NSRouter("", &public.Auth{}, "POST:CreateNewAccount"),
),
beego.NSNamespace("/logout",
beego.NSRouter("", &public.Auth{}, "POST:Logout"),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:16,代码来源:auth.go
示例14: init
func init() {
ns := beego.NewNamespace("/v1",
beego.NSNamespace("/patient",
beego.NSRouter("/:id", &controllers.PatientController{}, "get:Get"),
),
)
beego.AddNamespace(ns)
}
开发者ID:nodar-chkuaselidze,项目名称:bee-api-test,代码行数:8,代码来源:router.go
示例15: getRepository
func getRepository() func(*beego.Namespace) {
ns := beego.NSNamespace("/repository",
beego.NSNamespace("/resources/:id",
beego.NSNamespace("/get",
beego.NSRouter("/:min/:number", &api.Repository{}, "GET:GetResources"),
),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:10,代码来源:repository.go
示例16: Load
// Load tells the framework to load the addresses for the router
func Load() {
developer :=
beego.NewNamespace("/developer",
beego.NSRouter("", &developer.Home{}, "GET:Display"),
data.Get(),
api.Get(),
tools.Get(),
)
beego.AddNamespace(developer)
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:13,代码来源:main.go
示例17: Get
// Get returns the namespace for institutions
func Get() *beego.Namespace {
ns := beego.NewNamespace("/institutions",
beego.NSRouter("", &institutions.Home{}, "*:Display"),
beego.NSNamespace("/:institution",
beego.NSRouter("", &institution.Institution{}, "GET:Display"),
// program
beego.NSNamespace("/program",
beego.NSNamespace("/:program",
beego.NSRouter("", &institution.Program{}, "GET:Display"),
),
),
// module
beego.NSNamespace("/module",
beego.NSNamespace("/:module",
beego.NSRouter("", &institution.Module{}, "GET:Display"),
),
),
),
)
return ns
}
开发者ID:cristian-sima,项目名称:Wisply,代码行数:22,代码来源:institution.go
示例18: init
func init() {
ns := beego.NewNamespace("/v1",
beego.NSNamespace("/admin",
beego.NSNamespace("/t_authority",
beego.NSInclude(
&controllers.TAuthorityController{},
),
),
beego.NSNamespace("/t_board",
beego.NSInclude(
&controllers.TBoardController{},
),
),
beego.NSNamespace("/t_message",
beego.NSInclude(
&controllers.TMessageController{},
),
),
beego.NSNamespace("/t_pin",
beego.NSInclude(
&controllers.TPinController{},
),
),
beego.NSNamespace("/t_profile",
beego.NSInclude(
&controllers.TProfileController{},
),
),
beego.NSNamespace("/t_role",
beego.NSInclude(
&controllers.TRoleController{},
),
),
beego.NSNamespace("/t_user",
beego.NSInclude(
&controllers.TUserController{},
),
),
),
beego.NSRouter("/signup", &controllers.TUserController{}, "*:SignUp"),
beego.NSRouter("/signin", &controllers.TUserController{}, "*:SignIn"),
beego.NSRouter("/signout", &controllers.TUserController{}, "*:SignOut"),
beego.NSRouter("/upload", &controllers.TUserController{}, "post:Upload"),
beego.NSRouter("/recommend", &controllers.TUserController{}, "*:Recommend"),
beego.NSRouter("/", &controllers.MainController{}, "*:Index"),
)
beego.AddNamespace(ns)
}
开发者ID:langziguilai,项目名称:HSNet,代码行数:54,代码来源:router.go
示例19: init
func init() {
beego.Router("/", &controllers.MainController{})
ns := beego.NewNamespace("/v1",
beego.NSNamespace("/users",
beego.NSRouter("/register",
&controllers.UserController{},
"post:Register"),
beego.NSRouter("/login",
&controllers.UserController{},
"post:Login"),
beego.NSRouter("/logout",
&controllers.UserController{},
"post:Logout"),
beego.NSRouter("/passwd",
&controllers.UserController{},
"post:Passwd"),
beego.NSRouter("/uploads",
&controllers.UserController{},
"post:Uploads"),
beego.NSRouter("/downloads",
&controllers.UserController{},
"get:Downloads"),
),
beego.NSNamespace("/roles",
beego.NSRouter("/:id",
&controllers.RoleController{},
"get:GetOne;put:Put;delete:Delete"),
beego.NSRouter("/",
&controllers.RoleController{},
"get:GetAll;post:Post"),
beego.NSRouter("/auth",
&controllers.RoleController{},
"post:Auth"),
),
)
beego.AddNamespace(ns)
}
开发者ID:guanlicome,项目名称:beego-demo,代码行数:37,代码来源:router.go
示例20: init
func init() {
//初始化namespace
//后台
adminNs :=
beego.NewNamespace("/admin",
beego.NSAutoRouter(&admin.ArticleController{}),
)
//api
apiNs :=
beego.NewNamespace("/api",
beego.NSRouter("/weather", &api.WeatherController{}, "get:Weather"),
)
//注册namespace
beego.AddNamespace(adminNs, apiNs)
}
开发者ID:xiaowa183,项目名称:lily,代码行数:20,代码来源:router.go
注:本文中的github.com/astaxie/beego.NSRouter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论