router.js 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const { router, controller } = app;
  7. router.get('/', controller.home.index);
  8. router.all('/demo', controller.home.demo);
  9. // 开放接口
  10. router.get('/naf/xzqh/list', controller.api.xzqh);
  11. router.get('/naf/category/:category/list', controller.api.list);
  12. router.get('/naf/category/:category/:group/list', controller.api.list);
  13. router.get('/naf/category/:category/fetch', controller.api.fetch);
  14. router.get('/naf/category/:category/:group/fetch', controller.api.fetch);
  15. // 字典分类
  16. router.get('/naf/category/list', controller.category.list);
  17. router.get('/naf/category/fetch', controller.category.fetch);
  18. router.post('/naf/category/create', controller.category.create);
  19. router.post('/naf/category/update', controller.category.update);
  20. router.get('/naf/category/delete', controller.category.delete);
  21. // 字典项
  22. router.get('/naf/items/:category/list', controller.items.list);
  23. router.get('/naf/items/:category/fetch', controller.items.fetch);
  24. router.post('/naf/items/:category/create', controller.items.create);
  25. router.post('/naf/items/:category/update', controller.items.update);
  26. router.get('/naf/items/:category/delete', controller.items.delete);
  27. router.get('/naf/items/:category/clear', controller.items.clear);
  28. };