Basic.go 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package routers
  2. import (
  3. "ERP_storage/controllers"
  4. beego "github.com/beego/beego/v2/server/web"
  5. )
  6. func init() {
  7. depot := beego.NewNamespace("/Depot",
  8. beego.NSRouter("/List", &controllers.BasicController{}, "*:Depot_List"), // 仓库列表
  9. beego.NSRouter("/Add", &controllers.BasicController{}, "*:Depot_Add"), // 获取仓库
  10. beego.NSRouter("/Edit", &controllers.BasicController{}, "*:Depot_Edit"), // 添加仓库
  11. beego.NSRouter("/Del", &controllers.BasicController{}, "*:Depot_Del"), // 删除仓库
  12. )
  13. product := beego.NewNamespace("/Product",
  14. beego.NSRouter("/List", &controllers.BasicController{}, "*:Product_List"), // 产品列表
  15. beego.NSRouter("/Add", &controllers.BasicController{}, "*:Product_Add"), // 添加产品
  16. beego.NSRouter("/Edit_Sort", &controllers.BasicController{}, "*:Product_Edit_Sort"), // 修改排序
  17. beego.NSRouter("/Edit", &controllers.BasicController{}, "*:Product_Edit"), // 编辑产品
  18. beego.NSRouter("/Del", &controllers.BasicController{}, "*:Product_Del"), // 删除产品
  19. beego.NSRouter("/Spec_List", &controllers.BasicController{}, "*:ProductSpec_List"), // 产品规格
  20. beego.NSRouter("/Model_List", &controllers.BasicController{}, "*:ProductModel_List"), // 产品型号
  21. beego.NSRouter("/Name_List", &controllers.BasicController{}, "*:ProductName_List"), // 产品名称
  22. )
  23. productClass := beego.NewNamespace("/ProductClass",
  24. beego.NSRouter("/List", &controllers.BasicController{}, "*:ProductClass_List"), // 产品分类列表
  25. beego.NSRouter("/Add", &controllers.BasicController{}, "*:ProductClass_Add"), // 获取产品分类
  26. beego.NSRouter("/Edit", &controllers.BasicController{}, "*:ProductClass_Edit"), // 添加产品分类
  27. beego.NSRouter("/Del", &controllers.BasicController{}, "*:ProductClass_Del"), // 删除产品分类
  28. )
  29. verifyItem := beego.NewNamespace("/VerifyItem",
  30. beego.NSRouter("/List", &controllers.BasicController{}, "*:VerifyItem_List"), // 验证项目列表
  31. beego.NSRouter("/Add", &controllers.BasicController{}, "*:VerifyItem_Add"), // 获取验证项目
  32. beego.NSRouter("/Edit", &controllers.BasicController{}, "*:VerifyItem_Edit"), // 添加验证项目
  33. beego.NSRouter("/Del", &controllers.BasicController{}, "*:VerifyItem_Del"), // 删除验证项目
  34. )
  35. beego.AddNamespace(depot, product, productClass, verifyItem)
  36. }