123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- 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)
- }
|