router.go 5.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package routers
  2. import (
  3. "cc-officialweb/controllers"
  4. "cc-officialweb/controllers/admin"
  5. beego "github.com/beego/beego/v2/server/web"
  6. )
  7. func init() {
  8. //前台官网
  9. beego.Router("/", &controllers.MainController{})
  10. beego.Router("/about", &controllers.AboutController{})
  11. beego.Router("/services", &controllers.ServicesController{})
  12. beego.Router("/recruit", &controllers.RecruitController{})
  13. beego.Router("/services/:id", &controllers.ServicesController{})
  14. beego.Router("/services-detail/:id", &controllers.ServicesDetailController{})
  15. beego.Router("/product", &controllers.ProductController{})
  16. beego.Router("/product/:id", &controllers.DetailController{})
  17. beego.Router("/product/:id/parameters", &controllers.DetailController{})
  18. beego.Router("/product/:id/instructions", &controllers.DetailController{})
  19. beego.Router("/product/:id/software", &controllers.DetailController{})
  20. beego.Router("/product/:id/accessories", &controllers.DetailController{})
  21. beego.Router("/portfolio", &controllers.MainController{})
  22. beego.Router("/contact", &controllers.ContactController{})
  23. //后台
  24. beego.Router("/admin", &admin.IndexController{})
  25. //beego.Router("/admin:any", &admin.IndexController{})
  26. //新闻管理
  27. beego.Router("/news", &controllers.NewController{})
  28. beego.Router("/news/:id", &controllers.NewController{}, "get:NewDetail")
  29. beego.Router("/api/news", &controllers.NewController{}, "post:GetAllNew")
  30. beego.Router("/api/news", &controllers.NewController{}, "get:GetNewDetail")
  31. beego.Router("/api/addnews", &controllers.NewController{}, "post:AddNews")
  32. beego.Router("/api/news", &controllers.NewController{}, "delete:DeleteNewsById")
  33. beego.Router("/api/news", &controllers.NewController{}, "put:UpdateNews")
  34. beego.Router("/api/newstype", &controllers.NewController{}, "get:GetNewsType")
  35. //资源管理
  36. beego.Router("/api/upload", &controllers.UploadImageController{})
  37. beego.Router("/api/updateResource", &controllers.UploadImageController{}, "put:UpdateResource")
  38. beego.Router("/api/resource", &controllers.UploadImageController{}, "delete:DeleteResourceById")
  39. beego.Router("/api/resource", &controllers.UploadImageController{}, "post:GetResource")
  40. beego.Router("/api/resource", &controllers.UploadImageController{}, "get:GetResourceById")
  41. //登录
  42. beego.Router("/logon", &controllers.LoginController{}, "post:Login")
  43. //文件资源管理
  44. beego.Router("/api/file", &controllers.UploadFileController{})
  45. //产品管理
  46. beego.Router("/api/product", &controllers.ProductController{}, "post:AddProduct")
  47. beego.Router("/api/product", &controllers.ProductController{}, "delete:DeleteProductById")
  48. beego.Router("/api/productAll", &controllers.ProductController{}, "post:GetAllProduct")
  49. beego.Router("/api/product", &controllers.ProductController{}, "put:UpdateProductById")
  50. beego.Router("/api/product", &controllers.ProductController{}, "get:GetProduct")
  51. beego.Router("/api/productisindex", &controllers.ProductController{}, "put:UpdateIsIndex")
  52. beego.Router("/api/productsort", &controllers.ProductController{}, "put:UpdateIsSort")
  53. //服务管理
  54. beego.Router("/api/service", &controllers.ServicesDetailController{}, "post:AddServices")
  55. beego.Router("/api/service", &controllers.ServicesDetailController{}, "put:UpdateServices")
  56. beego.Router("/api/service", &controllers.ServicesDetailController{}, "delete:DeleteServices")
  57. beego.Router("/api/allservice", &controllers.ServicesDetailController{}, "post:GetAllServices")
  58. beego.Router("/api/service", &controllers.ServicesDetailController{}, "get:GetServices")
  59. beego.Router("/api/getservice", &controllers.ServicesDetailController{}, "get:GetServe")
  60. //招募管理
  61. beego.Router("/api/recruit", &controllers.RecruitController{}, "post:AddRecruit")
  62. beego.Router("/api/recruit", &controllers.RecruitController{}, "put:UpdateRecruit")
  63. beego.Router("/api/recruit", &controllers.RecruitController{}, "delete:DeleteRecruit")
  64. beego.Router("/api/allrecruit", &controllers.RecruitController{}, "post:GetAllRecruit")
  65. beego.Router("/api/recruit", &controllers.RecruitController{}, "get:GetRecruit")
  66. //数据展示
  67. beego.Router("/api/data", &controllers.DataModelController{}, "get:GetData")
  68. beego.Router("/api/data", &controllers.DataModelController{}, "put:UpdataModel")
  69. beego.Router("/api/data", &controllers.DataModelController{}, "delete:DeleteDataModel")
  70. beego.Router("/api/data", &controllers.DataModelController{}, "post:AddDataModel")
  71. //新数据展示
  72. beego.Router("/api/datasall", &controllers.DataModelController{}, "post:GetDatas")
  73. beego.Router("/api/datas", &controllers.DataModelController{}, "put:UpdataData")
  74. beego.Router("/api/datas", &controllers.DataModelController{}, "delete:DeleteDataById")
  75. beego.Router("/api/datas", &controllers.DataModelController{}, "post:AddData")
  76. beego.Router("/api/datastype", &controllers.DataModelController{}, "get:GetDatasByType")
  77. beego.Router("/api/getdatatype", &controllers.DataModelController{}, "get:GetDataType")
  78. //联系我们
  79. beego.Router("/addcontact", &controllers.ContactController{}, "post:AddContact")
  80. beego.Router("/api/contact", &controllers.ContactController{}, "delete:DeleteContactById")
  81. beego.Router("/api/contactall", &controllers.ContactController{}, "post:GetAllContact")
  82. //友情链接
  83. beego.Router("/api/links", &controllers.LinksController{}, "post:AddLinks")
  84. beego.Router("/api/links", &controllers.LinksController{}, "delete:DeleteLinksById")
  85. beego.Router("/api/links", &controllers.LinksController{}, "put:UpdateLinks")
  86. beego.Router("/api/alllinks", &controllers.LinksController{}, "post:GetAllLinks")
  87. //产品类型管理
  88. beego.Router("/api/producttype", &controllers.ProductController{}, "post:AddProductType")
  89. beego.Router("/api/producttype", &controllers.ProductController{}, "get:GetProductType")
  90. beego.Router("/api/producttype", &controllers.ProductController{}, "delete:DeleteProductTypeById")
  91. beego.Router("/api/allproducttype", &controllers.ProductController{}, "post:GetAllProductType")
  92. beego.Router("/api/producttype", &controllers.ProductController{}, "put:UpdateProductType")
  93. }