router.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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(
  13. 'presentrcord',
  14. '/api/live/presentrcord',
  15. controller.presentrcord
  16. ); // index、create、show、destroy
  17. router.post(
  18. 'presentrcord',
  19. '/api/live/presentrcord/:id',
  20. controller.presentrcord.update
  21. );
  22. // 房间表设置路由
  23. router.resources('room', '/api/live/room', controller.room); // index、create、show、destroy
  24. router.post('room', '/api/live/room/:id', controller.room.update);
  25. // 房间表设置路由
  26. router.resources('roomchat', '/api/live/roomchat', controller.roomchat); // index、create、show、destroy
  27. router.post('roomchat', '/api/live/roomchat/:id', controller.roomchat.update);
  28. // 公共聊天设置路由
  29. router.resources('chat', '/api/live/chat', controller.chat); // index、create、show、destroy
  30. router.post('chat', '/api/live/chat/:id', controller.chat.update);
  31. // 对接会表设置路由
  32. router.get('/api/live/dock/getgoodslist', controller.dock.getgoodslist); // 模糊查询商品列表
  33. router.get('/api/live/dock/dockopenid', controller.dock.getdockByopenid); // 查询申请的对接列表
  34. router.get('/api/live/dock/dockfetch/:id', controller.dock.dockfetch); // 查询申请的对接列表
  35. router.get('/api/live/dock/myapply', controller.dock.myapply); // 查询申请的对接列表
  36. router.resources('dock', '/api/live/dock', controller.dock); // index、create、show、destroy
  37. router.post('dock', '/api/live/dock/:id', controller.dock.update);
  38. // router.post('dock', '/api/live/dock/check/:id', controller.dock.dockCheck);
  39. // 对接会申请表
  40. router.post('dock', '/api/live/dock/apply/:id', controller.dock.apply);
  41. // 申请用户产品列表
  42. router.post('dock', '/api/live/dock/goods/:id', controller.dock.goods);
  43. router.post(
  44. 'dock',
  45. '/api/live/dock/apply/:dock_id/check/:id',
  46. controller.dock.check
  47. );
  48. router.post('/api/live/dock/updatevipuser/:id', controller.dock.updatevipuser);
  49. router.post('/api/live/dock/createvipuser/:id', controller.dock.createvipuser);
  50. router.delete('/api/live/dock/deletevipuser/:id', controller.dock.vipdelete); // id 为vip的uid
  51. router.post('/api/live/dock/getdock/:id', controller.dock.getdock);
  52. router.post('/api/live/getapply', controller.dock.getapply);
  53. // 用户登录
  54. router.post('/api/live/login', controller.login.login);
  55. // 根据token取得用户信息
  56. router.post('/api/live/token', controller.login.token);
  57. // 用户退出登录
  58. router.post('/api/live/logout', controller.login.destroy);
  59. // 栏目表设置路由
  60. router.resources('column', '/api/live/column', controller.column); // index、create、show、destroy
  61. router.post('column', '/api/live/column/update/:id', controller.column.update
  62. );
  63. // 信息表设置路由
  64. router.resources('news', '/api/live/news', controller.news); // index、create、show、destroy
  65. router.post('news', '/api/live/news/update/:id', controller.news.update);
  66. // 在线指导信息表设置路由
  67. router.resources('newsguidance', '/api/live/newsguidance', controller.newsguidance); // index、create、show、destroy
  68. router.post('newsguidance', '/api/live/newsguidance/update/:id', controller.newsguidance.update);
  69. // 项目路演表设置路由
  70. router.resources('newsroadshow', '/api/live/newsroadshow', controller.newsroadshow); // index、create、show、destroy
  71. router.post('newsroadshow', '/api/live/newsroadshow/update/:id', controller.newsroadshow.update);
  72. // 信息表设置路由
  73. router.resources('comment', '/api/live/comment', controller.comment); // index、create、show、destroy
  74. router.post('comment', '/api/live/comment/update/:id', controller.comment.update);
  75. // 私人聊天室表设置路由
  76. router.resources('personroom', '/api/live/personroom', controller.personroom); // index、create、show、destroy
  77. router.post('personroom', '/api/live/personroom/update/:id', controller.personroom.update);
  78. // 私人聊天记录表设置路由
  79. router.resources('personchat', '/api/live/personchat', controller.personchat); // index、create、show、destroy
  80. router.post('personchat', '/api/live/personchat/update/:id', controller.personchat.update);
  81. router.post('personchat', '/api/live/personchat/received', controller.personchat.received); // 将消息设置成已读
  82. router.delete('/api/live/personroomtalk/:id', controller.personroomtalk.delete);
  83. router.get('/api/live/personroomtalk/countroom', controller.personroomtalk.countroom);
  84. // 科技在线频道
  85. router.resources('channel', '/api/live/channel', controller.channel); // index、create、show、destroy
  86. router.post('channel', '/api/live/channel/update/:id', controller.channel.update);
  87. router.post('channel', '/api/live/channel/login', controller.channel.login);
  88. // 科技频道录像
  89. router.resources('channelVideo', '/api/live/channelvideo', controller.channelVideo); // index、create、show、destroy
  90. router.post('channelVideo', '/api/live/channelvideo/update/:id', controller.channelVideo.update);
  91. // 花表
  92. router.resources('flower', '/api/live/flower', controller.flower); // index、create、show、destroy
  93. router.post('flower', '/api/live/flower/update/:id', controller.flower.update);
  94. // 展会信息表
  95. router.resources('imgtxtdock', '/api/live/imgtxtdock', controller.imgtxtdock); // index、create、show、destroy
  96. router.post('imgtxtdock', '/api/live/imgtxtdock/update/:id', controller.imgtxtdock.update);
  97. // 培训问诊表
  98. router.get('trainlive', '/api/live/trainlive/user/longer/:id', controller.trainlive.userLonger);
  99. router.post('trainlive', '/api/live/trainlive/login', controller.trainlive.login);
  100. router.post('trainlive', '/api/live/trainlive/user/login/:id', controller.trainlive.userLogin);
  101. router.post('trainlive', '/api/live/trainlive/user/logout/:id', controller.trainlive.userLogout);
  102. router.post('trainlive', '/api/live/trainlive/user/:id', controller.trainlive.addUser);
  103. router.delete('trainlive', '/api/live/trainlive/user/:id', controller.trainlive.deleteUser);
  104. router.post('trainlive', '/api/live/trainlive/user/update/:id', controller.trainlive.updateUser);
  105. router.post('trainlive', '/api/live/trainlive/update/:id', controller.trainlive.update);
  106. router.get('trainlive', '/api/live/trainlive/user/:id', controller.trainlive.userData);
  107. router.resources('trainlive', '/api/live/trainlive', controller.trainlive); // index、create、show、destroy
  108. router.resources('trainchat', '/api/live/trainchat', controller.trainchat); // index、create、show、destroy
  109. router.post('trainchat', '/api/live/trainchat/update/:id', controller.trainchat.update);
  110. };