router.js 5.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. router.post('/api/visit/login', controller.login.login); // 用户登录
  9. router.post('/api/visit/wxlogin', controller.login.wxlogin); // 微信用户登录
  10. router.resources('user', '/api/visit/user', controller.user); // index、create、show、destroy
  11. router.resources('doctor', '/api/visit/doctor', controller.doctor); // index、create、show、destroy
  12. router.post('doctor', '/api/visit/doctor/:id', controller.doctor.update);
  13. router.get('doctor', '/api/visit/doctor/findopenid', controller.doctor.findopenid);
  14. router.post('doctor', '/api/visit/doctor/:id/bind', controller.doctor.updateopenid);
  15. router.resources('nurse', '/api/visit/nurse', controller.nurse); // index、create、show、destroy
  16. router.post('nurse', '/api/visit/nurse/:id', controller.nurse.update);
  17. router.post('nurse', '/api/visit/nurse/login', controller.nurse.login);
  18. router.post('/api/visit/group/exit', controller.group.exit);
  19. router.resources('group', '/api/visit/group', controller.group); // index、create、show、destroy
  20. router.get('/api/visit/group/:id/info', controller.group.info);
  21. router.post('/api/visit/group/:id/info', controller.group.info);
  22. // 群里患者接口
  23. router.resources('grouppatients', '/api/visit/grouppatients', controller.grouppatients); // index、create、show
  24. router.get('/api/visit/grouppatients/:groupid/patients', controller.grouppatients.index); // index
  25. router.get('/api/visit/grouppatients/:groupid/patients/fetch', controller.grouppatients.fetch); // index
  26. router.post('/api/visit/grouppatients/:groupid/update/:id', controller.grouppatients.update); // update
  27. router.post('/api/visit/grouppatients/:groupid/destroy/:id', controller.grouppatients.destroy); // destroy
  28. router.resources('patient', '/api/visit/patient', controller.patient); // index、create、show、destroy
  29. router.get('/api/visit/patient/:id/info', controller.patient.info);
  30. router.get('/api/visit/patient/:id/doctors', controller.patient.doctors);
  31. router.get('/api/visit/patient/:id/groups', controller.patient.groups);
  32. router.post('/api/visit/patient/:id/info', controller.patient.info);
  33. router.get('patient', '/api/visit/patient/findopenid', controller.patient.findopenid);
  34. // 患者病历接口
  35. router.resources('patientemrs', '/api/visit/patientemrs', controller.patientemrs); // index、create、show
  36. router.get('/api/visit/patientemrs/:patientid/emrs', controller.patientemrs.index); // index
  37. router.get('/api/visit/patientemrs/:patientid/emrs/fetch/:emrid', controller.patientemrs.fetch); // index
  38. router.post('/api/visit/patientemrs/:patientid/create', controller.patientemrs.create); // update
  39. router.post('/api/visit/patientemrs/:patientid/update/:id', controller.patientemrs.update); // update
  40. router.delete('/api/visit/patientemrs/:patientid/destroy/:id', controller.patientemrs.destroy); // destroy
  41. router.get('/api/visit/rooms', controller.room.index); // index
  42. router.get('/api/visit/rooms/destroy/:id', controller.room.destroy); // destroy
  43. router.get('/api/visit/chat', controller.chat.index); // index
  44. router.post('/api/visit/chat/create', controller.chat.create); // update
  45. router.delete('/api/visit/chat/destroy/:id', controller.chat.destroy); // destroy
  46. router.get('/api/visit/groupchat', controller.groupchat.index); // index
  47. router.post('/api/visit/groupchat/create/:groupid', controller.groupchat.create); // update
  48. router.delete('/api/visit/groupchat/destroy/:id', controller.groupchat.destroy); // destroy
  49. // 微信认证,生成包含微信用户信息的token写入cookie
  50. router.get('/api/visit/auth', controller.weixin.auth);
  51. router.get('/api/visit/authBack', controller.weixin.authBack);
  52. router.post('/api/visit/getsign', controller.weixin.jsapiAuth);
  53. router.post('/api/visit/wxpaysign', controller.wxpay.wxpaysign); // 取得支付签名
  54. router.post('/api/visit/wxpayback', controller.wxpay.wxpaysignback); // 取得支付签名
  55. // 打赏管理
  56. router.get('/api/visit/doctormoney', controller.doctormoney.index); // index
  57. router.post('/api/visit/doctormoney/create/:doctorid', controller.doctormoney.create); // create
  58. router.delete('/api/visit/doctormoney/destroy/:id', controller.doctormoney.destroy); // destroy
  59. // 微信扫码登录,生成包含微信用户信息的token,存入redis
  60. router.post('/api/visit/qrcode/create', controller.qrcode.create); // 创建二维码
  61. router.post('/api/visit/qrcode/creategroup', controller.qrcode.createQrcode); // 创建群二维码
  62. router.post('/api/visit/qrcode/:qrcode/check', controller.qrcode.check); // 检查二维码状态
  63. router.get('/api/visit/qrcode/:qrcode/scan', controller.qrcode.scan); // 扫码确认页面
  64. router.post('/api/visit/qrcode/:qrcode/login', controller.qrcode.login); // 扫码登录确认
  65. router.post('/api/visit/qrcode/:qrcode/token', controller.qrcode.token); // 换取微信认证码
  66. // 广告
  67. router.resources('adv', '/api/visit/adv', controller.adv); // index、create、show、destroy
  68. router.post('/api/visit/adv/update/:id', controller.adv.update);
  69. // 医疗科普文章
  70. router.resources('article', '/api/visit/article', controller.article); // index、create、show、destroy
  71. router.post('/api/visit/article/update/:id', controller.article.update);
  72. // 备注
  73. router.get('/api/visit/remark/user', controller.remark.get);
  74. router.resources('remark', '/api/visit/remark', controller.remark); // index、create、show、destroy
  75. router.post('/api/visit/remark/update/:id', controller.remark.update);
  76. };