router.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. // 图片新闻类型
  19. router.post('/api/cms/imgtype/create', controller.imgtype.create);
  20. router.post('/api/cms/imgtype/update', controller.imgtype.update);
  21. router.delete('/api/cms/imgtype/delete/:id', controller.imgtype.delete);
  22. router.get('/api/cms/imgtype/query', controller.imgtype.query);
  23. // 图片新闻
  24. router.post('/api/cms/imgnews/create', controller.imgnews.create);
  25. router.post('/api/cms/imgnews/update', controller.imgnews.update);
  26. router.delete('/api/cms/imgnews/delete/:id', controller.imgnews.delete);
  27. router.get('/api/cms/imgnews/query', controller.imgnews.query);
  28. router.get('/api/cms/imgnews/fetch', controller.imgnews.fetch);
  29. // 菜单
  30. router.post('/api/cms/menus/create', controller.menu.create);
  31. router.post('/api/cms/menus/update', controller.menu.update);
  32. router.delete('/api/cms/menus/delete/:id', controller.menu.delete);
  33. router.get('/api/cms/menus/query', controller.menu.query);
  34. // 单页
  35. router.post('/api/cms/pages/create', controller.pages.create);
  36. router.post('/api/cms/pages/update', controller.pages.update);
  37. router.delete('/api/cms/pages/delete/:id', controller.pages.delete);
  38. router.get('/api/cms/pages/query', controller.pages.query);
  39. router.get('/api/cms/pages/fetch', controller.pages.fetch);
  40. // 配置
  41. router.post('/api/cms/toconfig/create', controller.toconfig.create);
  42. router.post('/api/cms/toconfig/update', controller.toconfig.update);
  43. router.delete('/api/cms/toconfig/delete/:id', controller.toconfig.delete);
  44. router.get('/api/cms/toconfig/query', controller.toconfig.query);
  45. };