router.js 1.2 KB

123456789101112131415161718192021222324252627282930313233
  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. // 礼物表设置路由
  9. router.resources('present', '/api/live/present', controller.present); // index、create、show、destroy
  10. router.post('present', '/api/live/present/:id', controller.present.update);
  11. // 礼物表设置路由
  12. router.resources('presentrcord', '/api/live/presentrcord', controller.presentrcord); // index、create、show、destroy
  13. router.post('presentrcord', '/api/live/presentrcord/:id', controller.presentrcord.update);
  14. // 房间表设置路由
  15. router.resources('room', '/api/live/room', controller.room); // index、create、show、destroy
  16. router.post('room', '/api/live/room/:id', controller.room.update);
  17. // 房间表设置路由
  18. router.resources('roomchat', '/api/live/roomchat', controller.roomchat); // index、create、show、destroy
  19. router.post('roomchat', '/api/live/roomchat/:id', controller.roomchat.update);
  20. // 房间表设置路由
  21. router.resources('chat', '/api/live/chat', controller.chat); // index、create、show、destroy
  22. router.post('chat', '/api/live/chat/:id', controller.chat.update);
  23. };