Esempio n. 1
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/moment",
			beego.NSInclude(
				&controllers.MomentController{},
			),
		),
		beego.NSNamespace("/comment",
			beego.NSInclude(
				&controllers.CommentController{},
			),
		),
		beego.NSNamespace("/like",
			beego.NSInclude(
				&controllers.LikeController{},
			),
		),
		beego.NSNamespace("/block",
			beego.NSInclude(
				&controllers.BlockController{},
			),
		),
		beego.NSNamespace("/unshare",
			beego.NSInclude(
				&controllers.UnshareController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 2
0
func init() {
	ns := beego.NewNamespace("/v1",

		beego.NSNamespace("/comments",
			beego.NSInclude(
				&controllers.CommentsController{},
			),
		),

		beego.NSNamespace("/posts",
			beego.NSInclude(
				&controllers.PostsController{},
			),
		),

		beego.NSNamespace("/users",
			beego.NSInclude(
				&controllers.UsersController{},
			),
		),
		beego.NSNamespace("/jwt",
			beego.NSInclude(
				&controllers.JwtController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 3
0
func init() {
	if beego.BConfig.RunMode == "dev" {
		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/doc"] = "swagger"
	}

	ns := beego.NewNamespace("/v1.0",
		beego.NSNamespace("/auth", beego.NSInclude(&controllers.AuthController{})),
		beego.NSNamespace("/user", beego.NSInclude(&controllers.UserController{})),
		beego.NSNamespace("/host", beego.NSInclude(&controllers.HostController{})),
	)
	beego.AddNamespace(ns)

}
Esempio n. 4
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/ai",
			beego.NSInclude(
				&controllers.AIController{},
			),
		),
		beego.NSNamespace("/webchat",
			beego.NSInclude(
				&controllers.WebChatController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 5
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/object",
			beego.NSInclude(
				&controllers.ObjectController{},
			),
		),
		beego.NSNamespace("/user",
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 6
0
func init() {
	ns := beego.NewNamespace("/cddapi/SpeCpMobile",
		beego.NSNamespace("/get_sites_status",
			beego.NSInclude(
				&controllers.SitesStatusController{},
			),
		),
		beego.NSNamespace("/user",
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 7
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/lov",
			beego.NSInclude(
				&controllers.LovController{},
			),
		),
		beego.NSNamespace("/invest",
			beego.NSInclude(
				&controllers.InvestContractController{},
			),
		),
	)
	beego.AddNamespace(ns)

}
Esempio n. 8
0
func init() {
	ns := beego.NewNamespace("/fault",
		beego.NSNamespace("/fault_data",
			beego.NSInclude(
				&controllers.FaultDataController{},
			),
		),
		beego.NSNamespace("/down",
			beego.NSInclude(
				&controllers.DownController{},
			),
		),
	)
	beego.AddNamespace(ns)
	beego.Router("fault", &controllers.FaultDataController{})
}
Esempio n. 9
0
func init() {
	fmt.Println("start route config")
	beego.Router("/", &controllers.MainController{})
	//beego.Router("/post", &controllers.PostController{})
	//beego.Router("/user", &controllers.UserController{})

	ns := beego.NewNamespace("/v1",
		beego.NSCond(func(ctx *context.Context) bool {
			//if ctx.Input.Domain() == "api.genffy.com" {
			//	return true
			//}
			//return false
			fmt.Println(ctx.Input.Domain())
			return true
		}),
		// beego.NSRouter("/index", &controllers.MainController{}, "get:ShowAPIVersion"),
		// beego.NSBefore(auth),
		beego.NSNamespace("/post",
			beego.NSInclude(
				// 对应的注解路由
				&controllers.PostController{},
			),
		),
		beego.NSNamespace("/auth",
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
		beego.NSNamespace("/comment",
			beego.NSInclude(
				&controllers.CommentController{},
			),
		),
		beego.NSNamespace("/meta",
			beego.NSInclude(
				&controllers.MetaController{},
			),
		),
		// 测试超时
		// beego.NSNamespace("test",
		// 	beego.NSInclude(
		// 		&controllers.TestController{},
		// 	),
		// ),
	)
	beego.AddNamespace(ns)
}
func init() {
	ns := beego.NewNamespace("/v1",

		beego.NSNamespace("/departments",
			beego.NSInclude(
				&controllers.DepartmentsController{},
			),
		),

		beego.NSNamespace("/employees",
			beego.NSInclude(
				&controllers.EmployeesController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 11
0
File: main.go Progetto: shaalx/news
func main() {
	ns := beego.NewNamespace("/js",
		beego.NSInclude(&controllers.NewsController{}),
	)
	beego.AddNamespace(ns)
	app := beego.Include(&controllers.NewsVController{})
	app.Run()
}
Esempio n. 12
0
File: router.go Progetto: jf/gwp
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/post",
			beego.NSInclude(
				&controllers.PostController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 13
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/crawl",
			beego.NSInclude(
				&controllers.ObjectController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 14
0
func init() {
	ns := beego.NewNamespace("/v1", //v1 :版本号
		beego.NSNamespace("/weather", //天气API  e.g. http://127.0.0.1:8888/v1/weather/:id
			beego.NSInclude(
				&controllers.ShowWeatherController{},
			),
		),
		beego.NSNamespace("/city", //城市id API  e.g. http://127.0.0.1:8888/v1/city/:name
			beego.NSInclude(
				&controllers.CityContentController{},
			),
		),
		beego.NSNamespace("/cocserver", //cocserver API  e.g. http://127.0.0.1:8888/v1/cocserver/:warid
			beego.NSInclude(
				&controllers.WarDataController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 15
0
func init() {
	// namespace
	ns := beego.NewNamespace("/v1",
		// sub namespace
		beego.NSNamespace("/object",
			// inject annotation router
			beego.NSInclude(
				&controllers.ObjectController{},
			),
		),
		// sub namespace
		beego.NSNamespace("/user",
			// inject annotation router
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 16
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/user",
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
		beego.NSNamespace("/status",
			beego.NSInclude(
				&controllers.StatusController{},
			),
		),
		beego.NSNamespace("/category",
			beego.NSInclude(
				&controllers.CategoryController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 17
0
func init() {
	ns := beego.NewNamespace("/v1",

		beego.NSNamespace("/app",
			beego.NSInclude(
				&controllers.AppController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 18
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/auth",
			beego.NSInclude(
				&controllers.AuthenticationController{},
			),
		),
	)
	beego.AddNamespace(ns)

}
Esempio n. 19
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/manage",
			beego.NSInclude(
				&controllers.ManageController{},
			),
		),
	)
	beego.AddNamespace(ns)

}
Esempio n. 20
0
func init() {
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/users",
			beego.NSInclude(
				&controllers.UsersController{},
			),
		),
		beego.NSNamespace("/tokens",
			beego.NSInclude(
				&controllers.TokensController{},
			),
		),
		beego.NSNamespace("/verifications",
			beego.NSInclude(
				&controllers.VerificationsController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 21
0
func init() {
	beego.Router("/", &controllers.MainController{}, "get:Home")

	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/posts",
			beego.NSInclude(
				&controllers.PostController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 22
0
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)
}
Esempio n. 23
0
func init() {
	filterAccess := func(ctx *context.Context) {
		ctx.Output.Header("Access-Control-Allow-Origin", "*")
	}

	beego.InsertFilter("/swagger", beego.BeforeExec, filterAccess, true)

	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/data_set",
			beego.NSInclude(
				&controllers.DataSetController{},
			),
		),
		beego.NSNamespace("/job",
			beego.NSInclude(
				&controllers.JobController{},
			),
		),
		beego.NSNamespace("/node",
			beego.NSInclude(
				&controllers.NodeController{},
			),
		),
		beego.NSNamespace("/job_slice",
			beego.NSInclude(
				&controllers.JobSliceController{},
			),
		),
		beego.NSNamespace("/result_set",
			beego.NSInclude(
				&controllers.ResultSetController{},
			),
		),
	)

	beego.AddNamespace(ns)

}
Esempio n. 24
0
func init() {
	//beego.Router("/", &controllers.MainController{})
	//beego.Router("/article", &controllers.DcArticleController{})
	//beego.Router("/product", &controllers.DcProductController{})
	/*
	    ns := beego.NewNamespace("/vi",

			beego.NSNamespace("/dc_article",
				beego.NSInclude(
					&controllers.DcArticleController{},
				),
			),

			beego.NSNamespace("/dc_product",
				beego.NSInclude(
					&controllers.DcProductController{},
				),
			),
		)
		beego.AddNamespace(ns)
	*/
	ns := beego.NewNamespace("/api",

		beego.NSNamespace("/article",
			beego.NSInclude(
				&controllers.DcArticleController{},
			),
		),

		beego.NSNamespace("/product",
			beego.NSInclude(
				&controllers.DcProductController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 25
0
func init() {
	//	注册路由
	beego.Router("/", &controllers.ViewController{}, "Get:Index;Post:Login")
	beego.Router("/signOut", &controllers.ViewController{}, "Get:SignOut")
	beego.Router("/error", &controllers.ViewController{}, "Get:Error")

	api := beego.NewNamespace("/api",
		beego.NSNamespace("/student",
			beego.NSInclude(
				&controllers.APIStudentController{},
			),
		),
		beego.NSNamespace("/admin",
			beego.NSInclude(
				&controllers.APIAdminController{},
			),
		),
		beego.NSNamespace("/teacher",
			beego.NSInclude(
				&controllers.APITeacherController{},
			),
		),
	)

	view := beego.NewNamespace("/view",
		beego.NSNamespace("/student",
			beego.NSInclude(
				&controllers.ViewStudentController{},
			),
		),
		beego.NSNamespace("/admin",
			beego.NSInclude(
				&controllers.ViewAdminController{},
			),
		),
		beego.NSNamespace("/teacher",
			beego.NSInclude(
				&controllers.ViewTeatherController{},
			),
		),
	)
	beego.AddNamespace(api)
	beego.AddNamespace(view)
	AddRouterFilter()
}
Esempio n. 26
0
func init() {
	// beego.InsertFilter("/*", beego.BeforeRouter, checkFilter)
	ns := beego.NewNamespace("/v1",
		beego.NSNamespace("/dev",
			beego.NSInclude(
				&controllers.DevController{},
			),
			// beego.NSRouter("/register", &controllers.RegisterController{}),
		),
		beego.NSNamespace("/user",
			beego.NSBefore(check),
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
		beego.NSNamespace("/character",
			beego.NSBefore(check),
			beego.NSInclude(
				&controllers.CharacterController{},
			),
		),
		beego.NSNamespace("/movie",
			beego.NSBefore(check),
			beego.NSInclude(
				&controllers.MovieController{},
			),
		),
		beego.NSNamespace("/music",
			beego.NSBefore(check),
			beego.NSInclude(
				&controllers.MusicController{},
			),
		),
	)
	//管理员权限
	admin_ns := beego.NewNamespace("/admin",
		beego.NSBefore(auth),
		beego.NSInclude(
			&admin.AdminController{},
		),
	)
	beego.AddNamespace(ns, admin_ns)
}
Esempio n. 27
0
func init() {
	ns := beego.NewNamespace("/v1",

		beego.NSNamespace("/comments",
			beego.NSInclude(
				&controllers.CommentsController{},
			),
		),

		beego.NSNamespace("/course",
			beego.NSInclude(
				&controllers.CourseController{},
			),
		),

		beego.NSNamespace("/coursetype",
			beego.NSInclude(
				&controllers.CoursetypeController{},
			),
		),

		beego.NSNamespace("/userprofile",
			beego.NSInclude(
				&controllers.UserprofileController{},
			),
		),

		beego.NSNamespace("/users",
			beego.NSInclude(
				&controllers.UsersController{},
			),
		),

		beego.NSNamespace("/usertype",
			beego.NSInclude(
				&controllers.UsertypeController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 28
0
func init() {
	ns := beego.NewNamespace("/v1.0",

		beego.NSNamespace("/node",
			beego.NSInclude(
				&controllers.NodeController{},
			),
		),
		beego.NSNamespace("/cluster",
			beego.NSInclude(
				&controllers.ClusterController{},
			),
		),
		beego.NSNamespace("/network",
			beego.NSInclude(
				&controllers.NetworkController{},
			),
		),
		beego.NSNamespace("/service",
			beego.NSInclude(
				&controllers.ServiceController{},
			),
		),
		beego.NSNamespace("/software",
			beego.NSInclude(
				&controllers.SoftwareController{},
			),
		),
		beego.NSNamespace("/storage",
			beego.NSInclude(
				&controllers.StorageController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 29
0
func init() {
	ns := beego.NewNamespace("/v1",

		beego.NSNamespace("/mgt_resource",
			beego.NSInclude(
				&controllers.MgtResourceController{},
			),
		),

		beego.NSNamespace("/mgt_role",
			beego.NSInclude(
				&controllers.MgtRoleController{},
			),
		),

		beego.NSNamespace("/mgt_user",
			beego.NSInclude(
				&controllers.MgtUserController{},
			),
		),

		beego.NSNamespace("/zy_abroad_parcel",
			beego.NSInclude(
				&controllers.ZyAbroadParcelController{},
			),
		),

		beego.NSNamespace("/zy_address_template",
			beego.NSInclude(
				&controllers.ZyAddressTemplateController{},
			),
		),

		beego.NSNamespace("/zy_bill_order",
			beego.NSInclude(
				&controllers.ZyBillOrderController{},
			),
		),

		beego.NSNamespace("/zy_bill_record",
			beego.NSInclude(
				&controllers.ZyBillRecordController{},
			),
		),

		beego.NSNamespace("/zy_category",
			beego.NSInclude(
				&controllers.ZyCategoryController{},
			),
		),

		beego.NSNamespace("/zy_domestic_parcel",
			beego.NSInclude(
				&controllers.ZyDomesticParcelController{},
			),
		),

		beego.NSNamespace("/zy_link",
			beego.NSInclude(
				&controllers.ZyLinkController{},
			),
		),

		beego.NSNamespace("/zy_menu",
			beego.NSInclude(
				&controllers.ZyMenuController{},
			),
		),

		beego.NSNamespace("/zy_option",
			beego.NSInclude(
				&controllers.ZyOptionController{},
			),
		),

		beego.NSNamespace("/zy_parcel",
			beego.NSInclude(
				&controllers.ZyParcelController{},
			),
		),

		beego.NSNamespace("/zy_parcel_charge",
			beego.NSInclude(
				&controllers.ZyParcelChargeController{},
			),
		),

		beego.NSNamespace("/zy_parcel_ext",
			beego.NSInclude(
				&controllers.ZyParcelExtController{},
			),
		),

		beego.NSNamespace("/zy_parcel_relation",
			beego.NSInclude(
				&controllers.ZyParcelRelationController{},
			),
		),

		beego.NSNamespace("/zy_parcel_route",
			beego.NSInclude(
				&controllers.ZyParcelRouteController{},
			),
		),

		beego.NSNamespace("/zy_picture",
			beego.NSInclude(
				&controllers.ZyPictureController{},
			),
		),

		beego.NSNamespace("/zy_post",
			beego.NSInclude(
				&controllers.ZyPostController{},
			),
		),

		beego.NSNamespace("/zy_recommend",
			beego.NSInclude(
				&controllers.ZyRecommendController{},
			),
		),

		beego.NSNamespace("/zy_system_notice",
			beego.NSInclude(
				&controllers.ZySystemNoticeController{},
			),
		),

		beego.NSNamespace("/zy_unique_code",
			beego.NSInclude(
				&controllers.ZyUniqueCodeController{},
			),
		),

		beego.NSNamespace("/zy_user_account",
			beego.NSInclude(
				&controllers.ZyUserAccountController{},
			),
		),

		beego.NSNamespace("/zy_user_address",
			beego.NSInclude(
				&controllers.ZyUserAddressController{},
			),
		),

		beego.NSNamespace("/zy_user_advice",
			beego.NSInclude(
				&controllers.ZyUserAdviceController{},
			),
		),

		beego.NSNamespace("/zy_user_consume",
			beego.NSInclude(
				&controllers.ZyUserConsumeController{},
			),
		),

		beego.NSNamespace("/zy_user_option",
			beego.NSInclude(
				&controllers.ZyUserOptionController{},
			),
		),

		beego.NSNamespace("/zy_user_social",
			beego.NSInclude(
				&controllers.ZyUserSocialController{},
			),
		),

		beego.NSNamespace("/zy_user_wallet",
			beego.NSInclude(
				&controllers.ZyUserWalletController{},
			),
		),

		beego.NSNamespace("/zy_verification_record",
			beego.NSInclude(
				&controllers.ZyVerificationRecordController{},
			),
		),

		beego.NSNamespace("/zy_wechat",
			beego.NSInclude(
				&controllers.WechatController{},
			),
		),
	)
	beego.AddNamespace(ns)
}
Esempio n. 30
0
func init() {
	beego.InsertFilter("/", beego.BeforeRouter, StaticFileServer)
	beego.InsertFilter("/*", beego.BeforeRouter, StaticFileServer)
	beego.ErrorController(&controllers.ErrorController{})
	ns := beego.NewNamespace("/api/v1",
		beego.NSNamespace("/hosts",
			beego.NSInclude(
				&controllers.HostsController{},
			),
		),
		beego.NSNamespace("/client",
			beego.NSInclude(
				&controllers.ClientController{},
			),
		),
		beego.NSNamespace("/appSets",
			beego.NSInclude(
				&controllers.AppSetsController{},
			),
		),
		beego.NSNamespace("/backupSets",
			beego.NSInclude(
				&controllers.BackupSetsController{},
			),
		),
		beego.NSNamespace("/clientJobs",
			beego.NSInclude(
				&controllers.ClientJobsController{},
			),
		),
		beego.NSNamespace("/oss",
			beego.NSInclude(
				&controllers.OssController{},
			),
		),
		beego.NSNamespace("/oas",
			beego.NSInclude(
				&controllers.OasController{},
			),
		),
		beego.NSNamespace("/oasJobs",
			beego.NSInclude(
				&controllers.OasJobsController{},
			),
		),
		beego.NSNamespace("/users",
			beego.NSInclude(
				&controllers.UserController{},
			),
		),
		beego.NSNamespace("/paths",
			beego.NSInclude(
				&controllers.PathsController{},
			),
		),
		beego.NSNamespace("/policies",
			beego.NSInclude(
				&controllers.PolicyController{},
			),
		),
		beego.NSNamespace("/records",
			beego.NSInclude(
				&controllers.RecordsController{},
			),
		),
		beego.NSNamespace("/auth",
			beego.NSInclude(
				&controllers.LoginController{},
			),
		),
		beego.NSNamespace("/roles",
			beego.NSInclude(
				&controllers.RolesController{},
			),
		),
		beego.NSNamespace("/version",
			beego.NSInclude(
				&controllers.VersionController{},
			),
		),
	)
	beego.AddNamespace(ns)
}