router.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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/cms/column/create', controller.column.create);
  9. router.post('/api/cms/column/update', controller.column.update);
  10. router.delete('/api/cms/column/delete/:id', controller.column.delete);
  11. router.get('/api/cms/column/query', controller.column.query);
  12. // 内容
  13. router.post('/api/cms/contents/create', controller.content.create);
  14. router.post('/api/cms/contents/update', controller.content.update);
  15. router.delete('/api/cms/contents/delete/:id', controller.content.delete);
  16. router.get('/api/cms/contents/query', controller.content.query);
  17. router.get('/api/cms/contents/fetch', controller.content.fetch);
  18. router.get('/api/cms/contents/search', controller.content.search);
  19. // 图片新闻类型
  20. router.post('/api/cms/imgtype/create', controller.imgtype.create);
  21. router.post('/api/cms/imgtype/update', controller.imgtype.update);
  22. router.delete('/api/cms/imgtype/delete/:id', controller.imgtype.delete);
  23. router.get('/api/cms/imgtype/query', controller.imgtype.query);
  24. // 图片新闻
  25. router.post('/api/cms/imgnews/create', controller.imgnews.create);
  26. router.post('/api/cms/imgnews/update', controller.imgnews.update);
  27. router.delete('/api/cms/imgnews/delete/:id', controller.imgnews.delete);
  28. router.get('/api/cms/imgnews/query', controller.imgnews.query);
  29. router.get('/api/cms/imgnews/fetch', controller.imgnews.fetch);
  30. // 菜单
  31. router.post('/api/cms/menus/create', controller.menu.create);
  32. router.post('/api/cms/menus/update', controller.menu.update);
  33. router.delete('/api/cms/menus/delete/:id', controller.menu.delete);
  34. router.get('/api/cms/menus/query', controller.menu.query);
  35. // 单页
  36. router.post('/api/cms/pages/create', controller.pages.create);
  37. router.post('/api/cms/pages/update', controller.pages.update);
  38. router.delete('/api/cms/pages/delete/:id', controller.pages.delete);
  39. router.get('/api/cms/pages/query', controller.pages.query);
  40. router.get('/api/cms/pages/fetch', controller.pages.fetch);
  41. // 配置
  42. router.post('/api/cms/toconfig/create', controller.toconfig.create);
  43. router.post('/api/cms/toconfig/update', controller.toconfig.update);
  44. router.delete('/api/cms/toconfig/delete/:id', controller.toconfig.delete);
  45. router.get('/api/cms/toconfig/query', controller.toconfig.query);
  46. };