123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- /**
- * REST API v1,以端点的形式提供。
- */
- const APIv1 = {
- Application: {
- Base: '/api/v1/application',
- BadgeNo: '/badge_no'
- },
- Chats: {
- Base: "/api/v1/chats",
- List: "/list",
- ListWithPatient: "/list/patient",
- ListWithDoctor: "/list/doctor",
- MsgAmount: "/msg/amount",
- Recent: '/recent',
- SearchAboutPatient: '/search/patient',
- SearchAboutPatientList: '/search/patient/list',
- SearchAbountPatientMore: '/search/patient/all',
- SearchAboutDoctor: '/search/doctor',
- SearchAboutDoctorList: '/search/doctor/list',
- SearchAbountDoctorContentDetail: '/search/doctor/content/list',
- // 所有未读消息数
- UnreadMsgCount: '/unread_count',
- Message: '/message', // 单条消息
- // 私信
- PM: '/pm',
- PMUnread: '/pm/unread',
- PMUnreadCount: '/pm/unread/count',
- PMStats: '/pm/statistic',
- PMFinished: '/pm/finished', // 当前会话是否已经结束
- // 组信
- GM: '/gm',
- GMUnread: '/gm/unread',
- GMUnreadCount: '/gm/unread/count',
- GMStats: '/gm/statistic',
- //系统消息
- SM: '/sm',
- TEST: '/test'
- },
- Users: {
- Base: '/api/v1/users',
- Login: '/login',
- Logout: '/logout',
- User: '/:user_id',
- UserStatus: '/:user_id/status'
- },
- Groups: {
- Base: '/api/v1/groups',
- Members: '/:group_id/members',
- MembersAvatar: '/member/avatars'
- },
- Management: {
- Base: '/api/v1/management',
- Health: '/health',
- DbStatus: '/db'
- }
- };
- /**
- * REST API v2,以端点的形式提供。
- */
- const APIv2 = {
- Application: {
- Base: '/api/v2/application',
- BadgeNo: '/badge_no'
- },
- Management: {
- Base: '/api/v2/management',
- Health: '/health',
- DbStatus: '/db'
- },
- Users: {
- Base: '/api/v2/users',
- Login: '/login',
- Logout: '/logout',
- User: '/:user_id',
- UserStatus: '/:user_id/status'
- },
- Sessions: {
- Base: '/api/v2/sessions',
- Session: '/:session_id',
- SessionSticky: '/:session_id/sticky', // 会话置顶,置顶使用PUT,取消置顶使用DELETE
- RecentSessions: '/recent', // 最近会话,使用类型过滤出'患者'或'医生'会话
- Topics: '/:session_id/topics',
- Topic: '/:session_id/topics/:topic_id', // 议题,指定ID的议题将返回其信息
- TopicEnded: '/:session_id/topics/:topic_id/ended', // 议题是否已结束,若top_id为current,则检查最后一个议题的状态
- Messages: '/:session_id/messages', // 会话消息
- MessagesByTopic: '/:session_id/topics/:topic_id/messages', // 议题消息
- Message: '/:session_id/messages/:message_id', // 单条消息
- SessionsUnreadMessageCount: '/unread_message_count', // 所有会话的未读消息数
- SessionUnreadMessageCount: '/:session_id/unread_message_count', // 指定会话的未读消息数
- SessionUnreadMessage: '/:session_id/messages/unread', // 会话未读消息
- Participants: '/:session_id/participants', // 会话所有成员
- ParticipantsAvatar: '/:session_id/participants/avatars', // 会话所有成员头像
- Participant: '/:session_id/participants/:participant_id', // 会话单个成员
- ParticipantAvatar: '/:session_id/participants/:participant_id/avatars' // 会话单个成员头像
- //SendMsg: '/send', //发送消息,使用POST
- //CreateSession: '/create',//创建会话, 使用POST
- //PushSessionUser: '/push',//往Session里面push人员,使用POST
- //RemoveSessionUser: '/remove'//将人员从session中移除,使用DELETE
- },
- Search: {
- Base: '/api/v2/search' // 搜索,语法借鉴ElasticSearch
- }
- };
- const pages = {
- Home: {
- Index: '/'
- },
- Socket: {
- Index: '/socket',
- Test: '/test'
- }
- };
- module.exports.PAGES = pages;
- module.exports.APIv1 = APIv1;
- module.exports.APIv2 = APIv2;
|