system.js 1.1 KB

123456789101112131415161718192021
  1. 'use strict';
  2. /**
  3. * @param {Egg.Application} app - egg application
  4. */
  5. module.exports = app => {
  6. const prefix = '/api/servicezhwl';
  7. const index = 'system';
  8. const { router, controller } = app;
  9. // xzqh行政区划
  10. router.get(`${prefix}/dictionary/xzqh`, controller[index].dictionary.xzqh);
  11. router.get(`${prefix}/dictionary/tree`, controller[index].dictionary.tree);
  12. router.resources('dictionary', `${prefix}/dictionary`, controller[index].dictionary); // index、create、show、destroy
  13. router.post('dictionary', `${prefix}/dictionary/update/:id`, controller[index].dictionary.update);
  14. // 定时任务
  15. router.get('schedule', `${prefix}/schedule/check`, controller[index].schedule.check);
  16. router.resources('schedule', `${prefix}/schedule`, controller[index].schedule); // index、create、show、destroy
  17. router.post('schedule', `${prefix}/schedule/update/:id`, controller[index].schedule.update);
  18. // 通知
  19. router.resources('notice', `${prefix}/notice`, controller[index].notice); // index、create、show、destroy
  20. router.post('notice', `${prefix}/notice/update/:id`, controller[index].notice.update);
  21. };