router.go 4.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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. //服务管理
  52. beego.Router("/api/service", &controllers.ServicesDetailController{}, "post:AddServices")
  53. beego.Router("/api/service", &controllers.ServicesDetailController{}, "put:UpdateServices")
  54. beego.Router("/api/service", &controllers.ServicesDetailController{}, "delete:DeleteServices")
  55. beego.Router("/api/allservice", &controllers.ServicesDetailController{}, "post:GetAllServices")
  56. beego.Router("/api/service", &controllers.ServicesDetailController{}, "get:GetServices")
  57. beego.Router("/api/getservice", &controllers.ServicesDetailController{}, "get:GetServe")
  58. //招募管理
  59. beego.Router("/api/recruit", &controllers.RecruitController{}, "post:AddRecruit")
  60. beego.Router("/api/recruit", &controllers.RecruitController{}, "put:UpdateRecruit")
  61. beego.Router("/api/recruit", &controllers.RecruitController{}, "delete:DeleteRecruit")
  62. beego.Router("/api/allrecruit", &controllers.RecruitController{}, "post:GetAllRecruit")
  63. beego.Router("/api/recruit", &controllers.RecruitController{}, "get:GetRecruit")
  64. //数据展示
  65. beego.Router("/api/data", &controllers.DataModelController{}, "get:GetData")
  66. beego.Router("/api/data", &controllers.DataModelController{}, "put:UpdataModel")
  67. beego.Router("/api/data", &controllers.DataModelController{}, "delete:DeleteDataModel")
  68. beego.Router("/api/data", &controllers.DataModelController{}, "post:AddDataModel")
  69. //新数据展示
  70. beego.Router("/api/datasall", &controllers.DataModelController{}, "post:GetDatas")
  71. beego.Router("/api/datas", &controllers.DataModelController{}, "put:UpdataData")
  72. beego.Router("/api/datas", &controllers.DataModelController{}, "delete:DeleteDataById")
  73. beego.Router("/api/datas", &controllers.DataModelController{}, "post:AddData")
  74. beego.Router("/api/datastype", &controllers.DataModelController{}, "get:GetDatasByType")
  75. beego.Router("/api/getdatatype", &controllers.DataModelController{}, "get:GetDataType")
  76. //联系我们
  77. beego.Router("/addcontact", &controllers.ContactController{}, "post:AddContact")
  78. beego.Router("/api/contact", &controllers.ContactController{}, "delete:DeleteContactById")
  79. beego.Router("/api/contactall", &controllers.ContactController{}, "post:GetAllContact")
  80. }