router.js 1.3 KB

12345678910111213141516171819202122232425262728
  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/media/praise/create', controller.praise.create);
  9. router.post('/api/media/praise/update', controller.praise.update);
  10. router.delete('/api/media/praise/delete/:id', controller.praise.delete);
  11. router.get('/api/media/praise/query', controller.praise.query);
  12. // 收藏
  13. router.post('/api/media/collect/create', controller.collect.create);
  14. router.post('/api/media/collect/update', controller.collect.update);
  15. router.delete('/api/media/collect/delete/:id', controller.collect.delete);
  16. router.get('/api/media/collect/query', controller.collect.query);
  17. // 评论
  18. router.post('/api/media/discuss/create', controller.discuss.create);
  19. router.post('/api/media/discuss/update', controller.discuss.update);
  20. router.delete('/api/media/discuss/delete/:id', controller.discuss.delete);
  21. router.get('/api/media/discuss/query', controller.discuss.query);
  22. // 留言
  23. router.post('/api/media/leave/create', controller.leave.create);
  24. router.post('/api/media/leave/update', controller.leave.update);
  25. router.delete('/api/media/leave/delete/:id', controller.leave.delete);
  26. router.get('/api/media/leave/query', controller.leave.query);
  27. };