// @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://web.me/
// @License Apache 2.0
// @LicenseUrl http://www.apache.org/licenses/LICENSE-2.0.html
package routers

import (
	"eta/eta_mobile/controllers"
	"eta/eta_mobile/controllers/data_manage"
	"eta/eta_mobile/controllers/data_manage/correlation"
	"eta/eta_mobile/controllers/data_manage/cross_variety"
	"eta/eta_mobile/controllers/data_manage/data_manage_permission"
	"eta/eta_mobile/controllers/data_manage/excel"
	future_good2 "eta/eta_mobile/controllers/data_manage/future_good"
	"eta/eta_mobile/controllers/data_manage/line_equation"
	"eta/eta_mobile/controllers/data_manage/line_feature"
	"eta/eta_mobile/controllers/data_manage/range_analysis"
	"eta/eta_mobile/controllers/data_manage/supply_analysis"
	"eta/eta_mobile/controllers/data_source"
	"eta/eta_mobile/controllers/data_stat"
	"eta/eta_mobile/controllers/document_manage"
	"eta/eta_mobile/controllers/english_report"
	"eta/eta_mobile/controllers/eta_forum"
	"eta/eta_mobile/controllers/eta_trial"
	"eta/eta_mobile/controllers/material"
	"eta/eta_mobile/controllers/report_approve"
	"eta/eta_mobile/controllers/roadshow"
	"eta/eta_mobile/controllers/sandbox"
	"eta/eta_mobile/controllers/semantic_analysis"
	"eta/eta_mobile/controllers/smart_report"
	"eta/eta_mobile/controllers/speech_recognition"
	"eta/eta_mobile/controllers/trade_analysis"
	"eta/eta_mobile/services"

	"github.com/beego/beego/v2/server/web"
	"github.com/beego/beego/v2/server/web/filter/cors"
)

func init() {
	//解决跨域问题
	web.InsertFilter("*", web.BeforeRouter, cors.Allow(&cors.Options{
		AllowAllOrigins:  true,
		AllowMethods:     []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"},
		AllowHeaders:     []string{"Origin", "Authorization", "Uuid", "Accesstoken", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
		ExposeHeaders:    []string{"Content-Length", "Access-Control-Allow-Origin", "Access-Control-Allow-Headers", "Content-Type"},
		AllowCredentials: true,
	}))

	web.InsertFilter("/v1/share/*", web.BeforeRouter, services.FilterShareUrl())
	ns := web.NewNamespace("/v1",
		web.NSNamespace("/ppt",
			web.NSInclude(
				&controllers.PptController{},
			),
			web.NSInclude(
				&controllers.PptCommonController{},
			),
		),
		web.NSNamespace("/sysuser",
			web.NSInclude(
				&controllers.SysUserController{},
			),
			web.NSInclude(
				&controllers.SysUserAuthController{},
			),
		),
		web.NSNamespace("/classify",
			web.NSInclude(
				&controllers.ClassifyController{},
			),
		),
		web.NSNamespace("/banner",
			web.NSInclude(
				&controllers.BannerController{},
			),
		),
		web.NSNamespace("/report",
			web.NSInclude(
				&controllers.ReportController{},
				&controllers.ReportChapterTypeController{},
			),
			web.NSInclude(
				&controllers.ReportCommonController{},
			),
			web.NSInclude(
				&controllers.ReportUploadCommonController{},
			),
		),
		web.NSNamespace("/voice",
			web.NSInclude(
				&controllers.VoiceController{},
			),
			web.NSInclude(
				&controllers.VoiceCommonController{},
			),
		),
		web.NSNamespace("/pptv2",
			web.NSInclude(
				&controllers.PptV2Controller{},
				&controllers.PptV2GroupController{},
			),
			web.NSInclude(
				&controllers.PptV2CommonController{},
			),
		),
		web.NSNamespace("/ppt_english",
			web.NSInclude(
				&controllers.PptEnglishController{},
				&controllers.PptEnglishGroupController{},
			),
			web.NSInclude(
				&controllers.PptEnglishCommonController{},
			),
		),
		web.NSNamespace("/entry",
			web.NSInclude(
				&controllers.TargetController{},
			),
			web.NSInclude(
				&controllers.TargetCommonController{},
			),
			web.NSInclude(
				&controllers.TradeCommonController{},
			),
		),

		web.NSNamespace("/system",
			web.NSInclude(
				&controllers.SysDepartmentController{},
			),
			web.NSInclude(
				&controllers.SysAdminController{},
			),
			web.NSInclude(
				&controllers.SysRoleController{},
			),
			web.NSInclude(
				&controllers.SysMenuController{},
			),
		),
		web.NSNamespace("/custom",
			web.NSInclude(
				&controllers.CompanySellerController{},
				&controllers.CompanyPermissionController{},
			),
		),
		web.NSNamespace("/resource",
			web.NSInclude(
				&controllers.ResourceController{},
				&controllers.ResourceAuthController{},
			),
		),
		web.NSNamespace("/datamanage",
			web.NSInclude(
				&data_manage.EdbInfoController{},
				&data_manage.EdbClassifyController{},
				&data_manage.ChartClassifyController{},
				&data_manage.ChartInfoController{},
				&excel.ExcelClassifyController{},
				&excel.ExcelInfoController{},
				&data_manage.PredictEdbClassifyController{},
				&data_manage.PredictEdbInfoController{},
				&data_manage.ChartThemeController{},
				&data_manage_permission.DataMangePermissionController{},
				&data_manage.ManualController{},
			),
		),
		web.NSNamespace("/my_chart",
			web.NSInclude(
				&data_manage.MyChartController{},
			),
		),
		web.NSNamespace("/roadshow",
			web.NSInclude(
				&roadshow.CalendarController{},
			),
		),
		web.NSNamespace("/taglib",
			web.NSInclude(
				&controllers.VarietyTagController{},
			),
		),
		web.NSNamespace("/sandbox",
			web.NSInclude(
				&sandbox.SandboxController{},
			),
		),
		web.NSNamespace("/pdfToImg",
			web.NSInclude(
				&controllers.PdfToImgCommonController{},
			),
		),
		web.NSNamespace("/english_report",
			web.NSInclude(
				&english_report.EnglishReportController{},
				&english_report.EnglishReportEmailController{},
				&english_report.EnglishCompanyController{},
			),
		),
		web.NSNamespace("/future_good",
			web.NSInclude(
				&future_good2.FutureGoodChartClassifyController{},
				&future_good2.FutureGoodChartInfoController{},
			),
		),
		web.NSNamespace("/correlation",
			web.NSInclude(
				&correlation.CorrelationChartClassifyController{},
				&correlation.CorrelationChartInfoController{},
			),
		),
		web.NSNamespace("/line_equation",
			web.NSInclude(
				&line_equation.LineEquationChartClassifyController{},
				&line_equation.LineEquationChartInfoController{},
			),
		),
		web.NSNamespace("/line_feature",
			web.NSInclude(
				&line_feature.LineFeaturesChartClassifyController{},
				&line_feature.LineFeaturesChartInfoController{},
			),
		),
		web.NSNamespace("/semantic_analysis",
			web.NSInclude(
				&semantic_analysis.SaCompareController{},
			),
		),
		web.NSNamespace("/supply_analysis",
			web.NSInclude(
				&supply_analysis.VarietyController{},
			),
		),
		web.NSNamespace("/en_permission",
			web.NSInclude(
				&english_report.EnPermissionController{},
			),
		),
		web.NSNamespace("/business_conf",
			web.NSInclude(
				&controllers.BusinessConfController{},
				&controllers.BusinessConfOpenController{},
			),
		),
		web.NSNamespace("/trade_analysis",
			web.NSInclude(
				&trade_analysis.TradeAnalysisController{},
			),
		),
		web.NSNamespace("/custom_analysis",
			web.NSInclude(
				&excel.CustomAnalysisController{},
			),
		),
		web.NSNamespace("/eta_trial",
			web.NSInclude(
				&eta_trial.EtaTrialController{},
			),
		),
		web.NSNamespace("/user_login",
			web.NSInclude(
				&controllers.UserLoginController{},
				&controllers.UserLoginAuthController{},
			),
		),
		web.NSNamespace("/data_stat/",
			web.NSInclude(
				&data_stat.EdbSourceStatController{},
				&data_stat.EdbTerminalController{},
			),
		),
		web.NSNamespace("/smart_report",
			web.NSInclude(
				&smart_report.SmartReportController{},
				&smart_report.SmartReportResourceController{},
			),
		),
		web.NSNamespace("/cross_variety", //跨品种分析
			web.NSInclude(
				&cross_variety.ClassifyController{},
				&cross_variety.ChartInfoController{},
				&cross_variety.VarietyController{},
				&cross_variety.TagController{},
			),
		),
		web.NSNamespace("/report_approve",
			web.NSInclude(
				&report_approve.ReportApproveController{},
				&report_approve.ReportApproveFlowController{},
			),
		),
		web.NSNamespace("/data_source",
			web.NSInclude(
				&data_source.DataSourceController{},
			),
		),
		web.NSNamespace("/permission",
			web.NSInclude(
				&controllers.ChartPermissionController{},
			),
		),
		web.NSNamespace("/message",
			web.NSInclude(
				&controllers.MessageController{},
			),
		),
		web.NSNamespace("/speech_recognition",
			web.NSInclude(
				&speech_recognition.SpeechRecognitionCommonController{},
				&speech_recognition.SpeechRecognitionController{},
				&speech_recognition.SpeechRecognitionMenuController{},
				&speech_recognition.SpeechRecognitionTagController{},
				&speech_recognition.SpeechRecognitionTagMenuController{},
			),
		),
		web.NSNamespace("/range_analysis",
			web.NSInclude(
				&range_analysis.RangeChartClassifyController{},
				&range_analysis.RangeChartChartInfoController{},
			),
		),
		web.NSNamespace("/document_manage",
			web.NSInclude(
				&document_manage.DocumentManageController{},
			),
		),
		web.NSNamespace("/material",
			web.NSInclude(
				&material.MaterialController{},
			),
		),
		web.NSNamespace("/eta_forum",
			web.NSInclude(
				&eta_forum.EtaForumController{},
			),
		),
	)
	web.AddNamespace(ns)
}
