1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package routers
- import (
- "github.com/gin-gonic/gin"
- "hongze/hrms_api/controller/system"
- "hongze/hrms_api/middleware"
- )
- func InitSystem(systemGroup *gin.RouterGroup) {
- //角色
- roleController := new(system.SysRoleController)
- roleGroup := systemGroup.Group("role/").Use(middleware.Token())
- roleGroup.GET("list", roleController.List)
- roleGroup.GET("menu/list", roleController.MenuList)
- roleGroup.POST("add", roleController.Add)
- roleGroup.PUT("menu/edit", roleController.EditMenu)
- roleGroup.DELETE("delete", roleController.Delete)
- //部门
- deptController := new(system.SysDeptController)
- deptGroup := systemGroup.Group("dept/").Use(middleware.Token())
- deptGroup.GET("list", deptController.List)
- deptGroup.POST("add", deptController.Add)
- deptGroup.PUT("edit", deptController.Edit)
- deptGroup.DELETE("delete", deptController.Delete)
- deptGroup.GET("admin", deptController.AdminList)
- //菜单
- menuController := new(system.SysMenuController)
- menuGroup := systemGroup.Group("menu/").Use(middleware.Token())
- menuGroup.POST("add", menuController.Add)
- menuGroup.POST("edit", menuController.Edit)
- menuGroup.GET("list", menuController.List)
- menuGroup.GET("buttons", menuController.ButtonList)
- menuGroup.GET("all_list", menuController.AllList)
- menuGroup.DELETE("delete", menuController.Delete)
- //管理员账号
- adminController := new(system.SysAdminController)
- adminGroup := systemGroup.Group("admin/").Use(middleware.Token())
- adminGroup.POST("add", adminController.Add)
- adminGroup.POST("del", adminController.Delete)
- adminGroup.POST("edit", adminController.Edit)
- adminGroup.GET("list", adminController.List)
- adminGroup.POST("modify/pwd", adminController.ModifyPwd)
- adminGroup.POST("modify/my/init_pwd", adminController.ModifyMyInitPwd)
- adminGroup.POST("modify/my/pwd", adminController.ModifyMyPwd)
- adminGroup.POST("modify/enabled", adminController.ModifyEnabled)
- }
|