router.go 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package routers
  2. import (
  3. "ERP_salary/controllers"
  4. errorlibs "git.baozhida.cn/ERP_libs/Error"
  5. beego "github.com/beego/beego/v2/server/web"
  6. )
  7. func init() {
  8. beego.ErrorController(&errorlibs.ErrorController{})
  9. //过滤器,拦截所有请求
  10. beego.InsertFilter("/*", beego.BeforeRouter, RBACFilter)
  11. ns := beego.NewNamespace("/Salary",
  12. beego.NSRouter("/List", &controllers.SalaryController{}, "*:Salary_List"), // 薪资列表
  13. beego.NSRouter("/User_List", &controllers.SalaryController{}, "*:Salary_User_List"), // 我的薪资列表
  14. beego.NSRouter("/Get", &controllers.SalaryController{}, "*:Salary_Get"), // 获取薪资
  15. beego.NSRouter("/User_Get", &controllers.SalaryController{}, "*:Salary_User_Get"), // 我的薪资
  16. beego.NSRouter("/Post", &controllers.SalaryController{}, "*:Salary_Post"), // 添加薪资
  17. beego.NSRouter("/Send", &controllers.SalaryController{}, "*:Send_Salary"), // 发送薪资
  18. beego.NSRouter("/Excel", &controllers.SalaryController{}, "*:Salary_Excel"), // 导出excel
  19. )
  20. ns2 := beego.NewNamespace("/Reimburse",
  21. //-----------费用类型
  22. beego.NSRouter("/FeeType/List", &controllers.ReimburseController{}, "*:FeeType_List"), //费用类型列表
  23. //-----------费用明细
  24. //beego.NSRouter("/FeeDetails/List", &controllers.ReimburseController{}, "*:FeeDetails_List"), // 费用明细列表
  25. //-----------左侧员工列表(只显示提交过报销的)
  26. beego.NSRouter("/User/List", &controllers.ReimburseController{}, "*:User_List"), // 左侧用户列表
  27. beego.NSRouter("/List", &controllers.ReimburseController{}, "*:Reimburse_List"), // 管理员报销列表
  28. beego.NSRouter("/User_List", &controllers.ReimburseController{}, "*:Reimburse_User_List"), // 员工报销列表
  29. beego.NSRouter("/Add", &controllers.ReimburseController{}, "*:Reimburse_Add"), // 添加报销
  30. beego.NSRouter("/Edit", &controllers.ReimburseController{}, "*:Reimburse_Edit"), // 修改报销
  31. beego.NSRouter("/Del", &controllers.ReimburseController{}, "*:Reimburse_Del"), // 删除报销
  32. beego.NSRouter("/Get", &controllers.ReimburseController{}, "*:Reimburse_Get"), // 报销详情
  33. beego.NSRouter("/Submit_Audit", &controllers.ReimburseController{}, "*:Reimburse_Submit_Audit"), // 提交审核
  34. beego.NSRouter("/Edit_Audit", &controllers.ReimburseController{}, "*:Reimburse_Edit_Audit"), // 修改审核状态
  35. beego.NSRouter("/Edit_Finance", &controllers.ReimburseController{}, "*:Reimburse_Edit_Finance"), // 修改(财务)
  36. )
  37. beego.AddNamespace(ns, ns2)
  38. }