system.go 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package routers
  2. import (
  3. "github.com/gin-gonic/gin"
  4. "hongze/fms_api/controller/system"
  5. "hongze/fms_api/middleware"
  6. )
  7. func InitSystem(systemGroup *gin.RouterGroup) {
  8. //角色
  9. roleController := new(system.SysRoleController)
  10. roleGroup := systemGroup.Group("role/").Use(middleware.Token())
  11. roleGroup.GET("list", roleController.List)
  12. roleGroup.GET("menu/list", roleController.MenuList)
  13. roleGroup.POST("add", roleController.Add)
  14. roleGroup.POST("edit", roleController.Edit)
  15. roleGroup.PUT("menu/edit", roleController.EditMenu)
  16. roleGroup.DELETE("delete", roleController.Delete)
  17. //部门
  18. deptController := new(system.SysDeptController)
  19. deptGroup := systemGroup.Group("dept/").Use(middleware.Token())
  20. deptGroup.GET("list", deptController.List)
  21. deptGroup.POST("add", deptController.Add)
  22. deptGroup.PUT("edit", deptController.Edit)
  23. deptGroup.DELETE("delete", deptController.Delete)
  24. deptGroup.GET("admin", deptController.AdminList)
  25. //菜单
  26. menuController := new(system.SysMenuController)
  27. menuGroup := systemGroup.Group("menu/").Use(middleware.Token())
  28. menuGroup.POST("add", menuController.Add)
  29. menuGroup.POST("edit", menuController.Edit)
  30. menuGroup.GET("list", menuController.List)
  31. menuGroup.GET("buttons", menuController.ButtonList)
  32. menuGroup.GET("all_list", menuController.AllList)
  33. menuGroup.DELETE("delete", menuController.Delete)
  34. //管理员账号
  35. adminController := new(system.SysAdminController)
  36. adminGroup := systemGroup.Group("admin/").Use(middleware.Token())
  37. adminGroup.POST("add", adminController.Add)
  38. adminGroup.POST("del", adminController.Delete)
  39. adminGroup.POST("edit", adminController.Edit)
  40. adminGroup.GET("list", adminController.List)
  41. adminGroup.POST("modify/pwd", adminController.ModifyPwd)
  42. adminGroup.POST("modify/my/init_pwd", adminController.ModifyMyInitPwd)
  43. adminGroup.POST("modify/my/pwd", adminController.ModifyMyPwd)
  44. adminGroup.POST("modify/enabled", adminController.ModifyEnabled)
  45. }