router.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. // 用户
  8. router.post('/api/naf/adminUser/create', controller.adminUser.create);
  9. router.post('/api/naf/adminUser/update', controller.adminUser.update);
  10. router.delete('/api/naf/adminUser/delete/:id', controller.adminUser.delete);
  11. router.get('/api/naf/adminUser/query', controller.adminUser.query);
  12. router.post('/api/naf/adminUser/updatePwd', controller.adminUser.updatePwd);
  13. // 角色
  14. router.post('/api/naf/role/create', controller.role.create);
  15. router.post('/api/naf/role/update', controller.role.update);
  16. router.delete('/api/naf/role/delete/:id', controller.role.delete);
  17. router.get('/api/naf/role/query', controller.role.query);
  18. // 菜单
  19. router.get('/api/naf/adminMenu/queryUserMenu', controller.adminMenu.queryUserMenu);
  20. router.get('/api/naf/adminMenu/query', controller.adminMenu.query);
  21. // 用户角色
  22. router.post('/api/naf/userBindRole/bind', controller.userBindRole.bind);
  23. router.post('/api/naf/userBindRole/unbind', controller.userBindRole.unbind);
  24. router.get('/api/naf/userBindRole/queryBind', controller.userBindRole.queryBind);
  25. router.get('/api/naf/userBindRole/queryRole', controller.userBindRole.queryRole);
  26. router.post('/api/naf/userBindRole/batchBind', controller.userBindRole.batchBind);
  27. router.post('/api/naf/userBindRole/batchUnBind', controller.userBindRole.batchUnBind);
  28. // 角色菜单
  29. router.post('/api/naf/roleBindMenu/bind', controller.roleBindMenu.bind);
  30. router.post('/api/naf/roleBindMenu/unbind', controller.roleBindMenu.unbind);
  31. router.get('/api/naf/roleBindMenu/queryBind', controller.roleBindMenu.queryBind);
  32. router.get('/api/naf/roleBindMenu/queryMenu', controller.roleBindMenu.queryMenu);
  33. router.post('/api/naf/roleBindMenu/batchBind', controller.roleBindMenu.batchBind);
  34. router.post('/api/naf/roleBindMenu/batchUnBind', controller.roleBindMenu.batchUnBind);
  35. };