package routers import ( "eta/eta_mini_crm_ht/controllers" beego "github.com/beego/beego/v2/server/web" "github.com/beego/beego/v2/server/web/filter/cors" ) func init() { beego.InsertFilter("*", beego.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, })) ns := beego.NewNamespace("/adminapi", beego.NSNamespace("/sys_user", beego.NSInclude( &controllers.UserLoginController{}, &controllers.SysUserController{}, ), ), beego.NSNamespace("/sys", beego.NSInclude( &controllers.SysConfigController{}, ), ), beego.NSNamespace("/department", beego.NSInclude( &controllers.SysDepartmentController{}, ), ), beego.NSNamespace("/order", beego.NSInclude( &controllers.OrderController{}, ), ), beego.NSNamespace("/role", beego.NSInclude( &controllers.SysRoleController{}, ), ), beego.NSNamespace("/chart_permission", beego.NSInclude( &controllers.ChartPermissionController{}, ), ), beego.NSNamespace("/user", beego.NSInclude( &controllers.UserController{}, ), ), beego.NSNamespace("/classify", beego.NSInclude( &controllers.ClassifyController{}, ), ), beego.NSNamespace("/feedBack", beego.NSInclude( &controllers.FeedBackController{}, ), ), beego.NSNamespace("/analyst", beego.NSInclude( &controllers.AnalystController{}, ), ), beego.NSNamespace("/media", beego.NSInclude( &controllers.AudioController{}, &controllers.VideoController{}, ), ), beego.NSNamespace("/source", beego.NSInclude( &controllers.ImageController{}, ), ), beego.NSNamespace("/message", beego.NSInclude( &controllers.MessageController{}, ), ), beego.NSNamespace("/risk", beego.NSInclude( &controllers.RiskConfigController{}, ), ), beego.NSNamespace("/customer", beego.NSInclude( &controllers.CustomerProductRiskMappingController{}, ), ), beego.NSNamespace("/merchant", beego.NSInclude( &controllers.MerchantController{}, ), ), beego.NSNamespace("/product", beego.NSInclude( &controllers.ProductController{}, ), ), ) beego.AddNamespace(ns) }