endpoints.js 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /**
  2. * REST API v2,以端点的形式提供。
  3. */
  4. const APIv2 = {
  5. Application: {
  6. Base: '/api/v2/application',
  7. BadgeNo: '/badge_no' //获取角标
  8. },
  9. Management: {
  10. Base: '/api/v2/management',
  11. Health: '/health',
  12. DbStatus: '/db'
  13. },
  14. Message: {
  15. Base: '/api/v2/message',
  16. Send: '/send', //发送消息,和会话无关,内外网通信
  17. DataMessage: '/dataMessage',
  18. CleanMessageToRedis: '/cleanMessageToRedis',
  19. DoctorSystemMessage: '/doctorSystemMessage',
  20. CloudCarePcManageMessage: '/cloudCarePcManageMessage',//
  21. CleanMessageLastFetchTimeToRedis: '/cleanMessageLastFetchTimeToRedis'
  22. },
  23. Users: {
  24. Base: '/api/v2/users',
  25. Login: '/login', //用户登录
  26. Logout: '/logout', //用户退出
  27. User: '/:user_id', //用户信息
  28. UserStatus: '/:user_id/status', //用户状态
  29. UserConsultTime:'/:user_id/consult/time' //用户咨询时间
  30. },
  31. Sessions: {
  32. Base: '/api/v2/sessions', //创建会话
  33. Session: '/:session_id/session', // 获取会话
  34. SessionListByType: '/sessionListByType', // 按会话类型获取会话
  35. SessionListByNoParticipant: '/sessionListByNoParticipant', //导诊获取没有参与会话的列表
  36. SessionCountByType: '/sessionCountByType', // 按会话类型获取会话数量
  37. SessionSticky: '/:session_id/sticky', // 会话置顶,置顶使用PUT,取消置顶使用DELETE
  38. SessionStatus: '/:session_id/status', // 更新状态
  39. SessionName: '/:session_id/name', // 更新会话名称
  40. RecentSessions: '/recent', // 最近会话,使用类型过滤出'患者'或'医生'会话
  41. IsExist: '/isExist', // 判断会话是否存在(i健康发送muc的im消息会话前会先调用创建会话的方法,这个方法会更新redis中每个成员的最后获取时间,导致未读消息不准)
  42. Topics: '/:topic_id/topics', // 获取单个议题
  43. Topic: '/topics/:topic_id', // 议题,指定ID的议题将返回其信息
  44. TopicEnded: '/:session_id/topics/:topic_id/ended', // 议题是否已结束,若top_id为current,则检查最后一个议题的状态
  45. TopicInto: '/:session_id/topics/:topic_id/into', // 居民进入议题
  46. TopicList:'/topics', //获取议题列表
  47. HealthTopicList:'/healthTopics', //健康咨询
  48. TopicListByType:'/topicListByType', //按类型查找咨询(未回复,进行中,已回复)
  49. TopicListCountByType:'/topicListCountByType', //按类型查找咨询(未回复,进行中,已回复)的数量
  50. HealthTeamTopicList:'/healthTeamTopics', //健康咨询(区分团队)
  51. TopicReplyCount:"/topics/count/reply", //议题回复数统计
  52. TopicMessages:'/topic/:topic_id/messages', //议题消息
  53. Messages: '/:session_id/messages', // 会话消息
  54. MessagesByTopic: '/:session_id/topics/:topic_id/messages', // 议题消息
  55. Message: '/:session_id/messages/:message_id', // 单条消息
  56. MessageUpdate: '/:session_id/messages/:message_id/update', // 更新消息内容(消息里有i健康业务状态时)
  57. SessionsUnreadMessageCount: '/unread_message_count', // 所有会话的未读消息数
  58. SessionUnreadMessageCount: '/:session_id/unread_message_count', // 指定会话的未读消息数
  59. SessionUnreadMessages: '/:session_id/messages/unread', // 会话未读消息
  60. ParticipantUpdate:'/:session_id/participant/update', //更新成员=删除旧成员,新增新成员
  61. ParticipantUpdateNew:'/:session_id/participant/updateNew', //更新成员=删除旧成员,新增新活跃成员
  62. Participants: '/:session_id/participants', // 会话所有成员
  63. ParticipantsAvatar: '/:session_id/participants/avatars', // 会话所有成员头像
  64. Participant: '/:session_id/participants/:participant_id', // 会话单个成员(多个participant_id 用英文逗号间隔)
  65. ParticipantAvatar: '/:session_id/participants/:participant_id/avatars' // 会话单个成员头像
  66. },
  67. Search: {
  68. Base: '/api/v2/search' // 搜索,下一版本的语法使用ElasticSearch
  69. },
  70. Demo:{
  71. Base:'/api/v2/demo'
  72. },
  73. Doctor: {//szx add ,针对中山医院视频通信
  74. Base: '/api/v2/doctor',
  75. AddDoctor: '/addDoctor' //新增医生
  76. }
  77. };
  78. const pages = {
  79. Home: {
  80. Index: '/'
  81. },
  82. Socket: {
  83. Index: '/socket',
  84. Test: '/test'
  85. }
  86. };
  87. module.exports.PAGES = pages;
  88. module.exports.APIv2 = APIv2;