endpoints.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /**
  2. * REST API,以端点的形式提供。
  3. *
  4. * 若想访问包含页面的内容,请在相应的API后面添加.html。
  5. */
  6. const APIv1 = {
  7. Application: {
  8. Base: '/api/v1/application',
  9. BadgeNo: '/badge_no'
  10. },
  11. Chats: {
  12. Base: "/api/v1/chats",
  13. List: "/list",
  14. ListWithPatient: "/list/patient",
  15. ListWithDoctor: "/list/doctor",
  16. Recent: '/recent',
  17. SearchAboutPatient: '/search/patient',
  18. SearchAboutDoctor: '/search/doctor',
  19. // 所有未读消息数
  20. UnreadMsgCount: '/unread_count',
  21. Message: '/message', // 单条消息
  22. // 私信
  23. PM: '/pm',
  24. PMUnread: '/pm/unread',
  25. PMUnreadCount: '/pm/unread/count',
  26. PMStats: '/pm/statistic',
  27. PMFinished: '/pm/finished', // 当前会话是否已经结束
  28. // 组信
  29. GM: '/gm',
  30. GMUnread: '/gm/unread',
  31. GMUnreadCount: '/gm/unread/count',
  32. GMStats: '/gm/statistic',
  33. //系统消息
  34. SM: '/sm'
  35. },
  36. Users: {
  37. Base: '/api/v1/users',
  38. Login: '/login',
  39. Logout: '/logout',
  40. User: '/:user_id',
  41. UserStatus: '/:user_id/status'
  42. },
  43. Groups: {
  44. Base: '/api/v1/groups',
  45. Members: '/:group_id/members',
  46. MembersAvatar: '/member/avatars'
  47. },
  48. Management: {
  49. Base: '/api/v1/management',
  50. Health: '/health',
  51. DbStatus: '/db'
  52. },
  53. Push: {
  54. Base: '/api/v1/push',
  55. Getui: '/getui'
  56. }
  57. };
  58. const pages = {
  59. Home: {
  60. Index: '/'
  61. },
  62. Socket: {
  63. Index: '/socket',
  64. Test: '/test'
  65. }
  66. };
  67. module.exports.PAGES = pages;
  68. module.exports.APIv1 = APIv1;