system.go 1.9 KB

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