1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- /**
- * REST API v2,以端点的形式提供。
- */
- const APIv2 = {
- Application: {
- Base: '/api/v2/application',
- BadgeNo: '/badge_no' //获取角标
- },
- Management: {
- Base: '/api/v2/management',
- Health: '/health',
- DbStatus: '/db'
- },
- Message: {
- Base: '/api/v2/message',
- Send: '/send', //发送消息,和会话无关,内外网通信
- DataMessage: '/dataMessage',
- CleanMessageToRedis: '/cleanMessageToRedis',
- DoctorSystemMessage: '/doctorSystemMessage',
- DoctorSystemMessageD: '/doctorSystemMessageD',
- CleanMessageLastFetchTimeToRedis: '/cleanMessageLastFetchTimeToRedis'
- },
- Users: {
- Base: '/api/v2/users',
- Login: '/login', //用户登录
- Logout: '/logout', //用户退出
- User: '/:user_id', //用户信息
- UserStatus: '/:user_id/status', //用户状态
- UserConsultTime:'/:user_id/consult/time' //用户咨询时间
- },
- Sessions: {
- Base: '/api/v2/sessions', //创建会话
- Session: '/:session_id/session', // 获取会话
- SessionListByType: '/sessionListByType', // 按会话类型获取会话
- SessionCountByType: '/sessionCountByType', // 按会话类型获取会话数量
- SessionSticky: '/:session_id/sticky', // 会话置顶,置顶使用PUT,取消置顶使用DELETE
- SessionStatus: '/:session_id/status', // 更新状态
- SessionName: '/:session_id/name', // 更新会话名称
- FixSessionToRedis: '/fixSessionToRedis', // 把会话写入redis
- RecentSessions: '/recent', // 最近会话,使用类型过滤出'患者'或'医生'会话
- IsExist: '/isExist', // 判断会话是否存在(i健康发送muc的im消息会话前会先调用创建会话的方法,这个方法会更新redis中每个成员的最后获取时间,导致未读消息不准)
- Topics: '/:topic_id/topics', // 获取单个议题
- Topic: '/topics/:topic_id', // 议题,指定ID的议题将返回其信息
- TopicEnded: '/:session_id/topics/:topic_id/ended', // 议题是否已结束,若top_id为current,则检查最后一个议题的状态
- TopicInto: '/:session_id/topics/:topic_id/into', // 居民进入议题
- TopicList:'/topics', //获取议题列表
- HealthTopicList:'/healthTopics', //健康咨询
- TopicListByType:'/topicListByType', //按类型查找咨询(未回复,进行中,已回复)
- TopicListCountByType:'/topicListCountByType', //按类型查找咨询(未回复,进行中,已回复)的数量
- HealthTeamTopicList:'/healthTeamTopics', //健康咨询(区分团队)
- TopicReplyCount:"/topics/count/reply", //议题回复数统计
- TopicMessages:'/topic/:topic_id/messages', //议题消息
- Messages: '/:session_id/messages', // 会话消息
- MessagesByTopic: '/:session_id/topics/:topic_id/messages', // 议题消息
- Message: '/:session_id/messages/:message_id', // 单条消息
- MessageUpdate: '/:session_id/messages/:message_id/update', // 更新消息内容(消息里有i健康业务状态时)
- SessionsUnreadMessageCount: '/unread_message_count', // 所有会话的未读消息数
- SessionsUnreadMessageCountByType: '/unread_message_count_type', // 按会话类型查找未读消息数
- SessionUnreadMessageCount: '/:session_id/unread_message_count', // 指定会话的未读消息数
- SessionUnreadMessages: '/:session_id/messages/unread', // 会话未读消息
- ParticipantUpdate:'/:session_id/participant/update', //更新成员=删除旧成员,新增新成员
- Participants: '/:session_id/participants', // 会话所有成员
- ParticipantsAvatar: '/:session_id/participants/avatars', // 会话所有成员头像
- Participant: '/:session_id/participants/:participant_id', // 会话单个成员(多个participant_id 用英文逗号间隔)
- ParticipantAvatar: '/:session_id/participants/:participant_id/avatars' // 会话单个成员头像
- },
- Search: {
- Base: '/api/v2/search' // 搜索,下一版本的语法使用ElasticSearch
- },
- Demo:{
- Base:'/api/v2/demo',
- sendWXTemplate: '/sendWXTemplate' // 获取会话
- }
- };
- const pages = {
- Home: {
- Index: '/'
- },
- Socket: {
- Index: '/socket',
- Test: '/test'
- }
- };
- module.exports.PAGES = pages;
- module.exports.APIv2 = APIv2;
|