// @APIVersion 1.0.0
// @Title beego Test API
// @Description beego has a very cool tools to autogenerate documents for your API
// @Contact astaxie@gmail.com
// @TermsOfServiceUrl http://beego.me/
// @License Apache 2.0
// @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
package routers

import (
	"github.com/beego/beego/v2/server/web"
	"github.com/beego/beego/v2/server/web/filter/cors"
	"hongze/hongze_cygx/controllers"
)

func init() {
	web.InsertFilter("*", web.BeforeRouter, cors.Allow(&cors.Options{
		AllowAllOrigins:  true,
		AllowMethods:     []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
		AllowHeaders:     []string{"Origin", "Account", "Authorization", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
		ExposeHeaders:    []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type", "Sign"},
		AllowCredentials: true,
	}))

	ns := web.NewNamespace("/api",
		web.NSNamespace("/home",
			web.NSInclude(
				&controllers.HomeController{},
			),
			web.NSInclude(
				&controllers.BaseHomeController{},
			),
		),
		web.NSNamespace("/wechat",
			web.NSInclude(
				&controllers.WechatController{},
				&controllers.WechatCommonController{},
			),
		),
		web.NSNamespace("/user",
			web.NSInclude(
				&controllers.UserController{},
				&controllers.UserCommonController{},
			),
		),
		web.NSNamespace("/permission",
			web.NSInclude(
				&controllers.ChartPermissionController{},
				&controllers.ChartPermissionAuthController{},
			),
		),
		web.NSNamespace("/article",
			web.NSInclude(
				&controllers.ArticleController{},
				&controllers.ArticleCommonController{},
				&controllers.ArticleControllerMobile{},
			),
		),
		web.NSNamespace("/config",
			web.NSInclude(
				&controllers.ConfigController{},
			),
			web.NSInclude(
				&controllers.BaseConfigController{},
			),
		),
		web.NSNamespace("/search",
			web.NSInclude(
				&controllers.SearchController{},
			),
			web.NSInclude(
				&controllers.BaseSearchController{},
			),
		),
		web.NSNamespace("/resource",
			web.NSInclude(
				&controllers.ResourceController{},
			),
		),
		web.NSNamespace("/advice",
			web.NSInclude(
				&controllers.AdviceController{},
			),
		),
		web.NSNamespace("/tactics",
			web.NSInclude(
				&controllers.TacticsController{},
			),
		),

		web.NSNamespace("/gushou",
			web.NSInclude(
				&controllers.GushouController{},
			),
		),
		web.NSNamespace("/report",
			web.NSInclude(
				&controllers.ReportController{},
			),
		),
		web.NSNamespace("/activity",
			web.NSInclude(
				&controllers.ActivityCoAntroller{},
				&controllers.ActivityABaseController{},
				&controllers.ActivityNoLoginController{},
			),
		),
		web.NSNamespace("/research",
			web.NSInclude(
				&controllers.ResearchController{},
			),
		),
		web.NSNamespace("/chart",
			web.NSInclude(
				&controllers.BaseChartController{},
				&controllers.ChartController{},
			),
		),
		web.NSNamespace("/report_billboard",
			web.NSInclude(
				&controllers.ReportBillboardController{},
			),
		),
		web.NSNamespace("/htgj",
			web.NSInclude(
				&controllers.BaseHtgjController{},
			),
		),
		web.NSNamespace("/micro_roadshow",
			web.NSInclude(
				&controllers.MicroRoadShowController{},
			),
		),
		web.NSNamespace("/activity_special",
			web.NSInclude(
				&controllers.ActivitySpecialCoAntroller{},
			),
		),
		web.NSNamespace("/industry",
			web.NSInclude(
				&controllers.IndustryController{},
			),
		),
		web.NSNamespace("/report_selection",
			web.NSInclude(
				&controllers.ReportSelectionController{},
			),
		),
		web.NSNamespace("/product_interior",
			web.NSInclude(
				&controllers.ProductInteriorController{},
			),
		),
		web.NSNamespace("/morning_meeting",
			web.NSInclude(
				&controllers.MorningMeetingController{},
			),
		),
		web.NSNamespace("/activity_signin",
			web.NSInclude(
				&controllers.ActivitySignCoAntroller{},
			),
		),
		web.NSNamespace("/banner",
			web.NSInclude(
				&controllers.BannerController{},
			),
		),
		web.NSNamespace("/tag",
			web.NSInclude(
				&controllers.TagController{},
			),
		),
		web.NSNamespace("/collection",
			web.NSInclude(
				&controllers.CollectionController{},
			),
		),
		web.NSNamespace("/yanxuan_special",
			web.NSInclude(
				&controllers.YanxuanSpecialController{},
			),
		),
		web.NSNamespace("/questionnaire",
			web.NSInclude(
				&controllers.QuestionnaireController{},
			),
		),
		web.NSNamespace("/ficc_report",
			web.NSInclude(
				&controllers.FiccYbController{},
			),
		),
	)
	web.AddNamespace(ns)
}
