|
@ -1,7 +1,5 @@
|
|
|
/**
|
|
|
* REST API,以端点的形式提供。
|
|
|
*
|
|
|
* 若想访问包含页面的内容,请在相应的API后面添加.html。
|
|
|
* REST API v1,以端点的形式提供。
|
|
|
*/
|
|
|
const APIv1 = {
|
|
|
Application: {
|
|
@ -9,24 +7,23 @@ const APIv1 = {
|
|
|
|
|
|
BadgeNo: '/badge_no'
|
|
|
},
|
|
|
|
|
|
Chats: {
|
|
|
Base: "/api/v1/chats",
|
|
|
|
|
|
List: "/list",
|
|
|
ListWithPatient: "/list/patient",
|
|
|
ListWithDoctor: "/list/doctor",
|
|
|
MsgAmount:"/msg/amount",
|
|
|
MsgAmount: "/msg/amount",
|
|
|
Recent: '/recent',
|
|
|
SearchAboutPatient: '/search/patient',
|
|
|
SearchAboutPatientList:'/search/patient/list',
|
|
|
SearchAbountPatientMore:'/search/patient/all',
|
|
|
SearchAboutPatientList: '/search/patient/list',
|
|
|
SearchAbountPatientMore: '/search/patient/all',
|
|
|
SearchAboutDoctor: '/search/doctor',
|
|
|
SearchAboutDoctorList: '/search/doctor/list',
|
|
|
SearchAbountDoctorContentDetail:'/search/doctor/content/list',
|
|
|
SearchAbountDoctorContentDetail: '/search/doctor/content/list',
|
|
|
|
|
|
// 所有未读消息数
|
|
|
UnreadMsgCount: '/unread_count',
|
|
|
|
|
|
Message: '/message', // 单条消息
|
|
|
|
|
|
// 私信
|
|
@ -44,9 +41,8 @@ const APIv1 = {
|
|
|
|
|
|
//系统消息
|
|
|
SM: '/sm',
|
|
|
TEST:'/test'
|
|
|
TEST: '/test'
|
|
|
},
|
|
|
|
|
|
Users: {
|
|
|
Base: '/api/v1/users',
|
|
|
|
|
@ -56,45 +52,76 @@ const APIv1 = {
|
|
|
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'
|
|
|
},
|
|
|
}
|
|
|
};
|
|
|
|
|
|
Push: {
|
|
|
Base: '/api/v1/push',
|
|
|
/**
|
|
|
* REST API v2,以端点的形式提供。
|
|
|
*/
|
|
|
const APIv2 = {
|
|
|
Application: {
|
|
|
Base: '/api/v2/application',
|
|
|
|
|
|
Getui: '/getui'
|
|
|
BadgeNo: '/badge_no'
|
|
|
},
|
|
|
Management: {
|
|
|
Base: '/api/v2/management',
|
|
|
|
|
|
Health: '/health',
|
|
|
DbStatus: '/db'
|
|
|
},
|
|
|
Users: {
|
|
|
Base: '/api/v2/users',
|
|
|
|
|
|
Sessions:{
|
|
|
Base:'/api/v1/session',//基础连接
|
|
|
Login: '/login',
|
|
|
Logout: '/logout',
|
|
|
|
|
|
SessionList:'/sessions', //获取会话列表
|
|
|
User: '/:user_id',
|
|
|
UserStatus: '/:user_id/status'
|
|
|
},
|
|
|
Sessions: {
|
|
|
Base: '/api/v2/sessions',
|
|
|
|
|
|
MessageList:'/messages', //获取消息列表
|
|
|
Session: '/:session_id',
|
|
|
SessionSticky: '/:session_id/sticky', // 会话置顶,置顶使用PUT,取消置顶使用DELETE
|
|
|
|
|
|
SendMsg:'/send', //发送消息
|
|
|
RecentSessions: '/recent', // 最近会话,使用类型过滤出'患者'或'医生'会话
|
|
|
|
|
|
CreateSession:'/create',//创建会话
|
|
|
Topics: '/:session_id/topics',
|
|
|
Topic: '/:session_id/topics/:topic_id', // 议题,指定ID的议题将返回其信息
|
|
|
TopicEnded: '/:session_id/topics/:topic_id/ended', // 议题是否已结束,若top_id为current,则检查最后一个议题的状态
|
|
|
|
|
|
StickSession:'/stick', //会话置顶
|
|
|
Messages: '/:session_id/messages', // 会话消息
|
|
|
MessagesByTopic: '/:session_id/topics/:topic_id/messages', // 议题消息
|
|
|
Message: '/:session_id/messages/:message_id', // 单条消息
|
|
|
|
|
|
UnStickSession:'/cancelStick',//取消置顶
|
|
|
SessionsUnreadMessageCount: '/unread_message_count', // 所有会话的未读消息数
|
|
|
SessionUnreadMessageCount: '/:session_id/unread_message_count', // 指定会话的未读消息数
|
|
|
SessionUnreadMessage: '/:session_id/messages/unread', // 会话未读消息
|
|
|
|
|
|
PushSessionUser:'/push',//往Session里面push人员
|
|
|
Participants: '/:session_id/participants', // 会话所有成员
|
|
|
ParticipantsAvatar: '/:session_id/participants/avatars', // 会话所有成员头像
|
|
|
Participant: '/:session_id/participants/:participant_id', // 会话单个成员
|
|
|
ParticipantAvatar: '/:session_id/participants/:participant_id/avatars' // 会话单个成员头像
|
|
|
|
|
|
RemoveSessionUser:'/remove'//将人员从session中移除
|
|
|
//SendMsg: '/send', //发送消息,使用POST
|
|
|
//CreateSession: '/create',//创建会话, 使用POST
|
|
|
//PushSessionUser: '/push',//往Session里面push人员,使用POST
|
|
|
//RemoveSessionUser: '/remove'//将人员从session中移除,使用DELETE
|
|
|
},
|
|
|
Search: {
|
|
|
Base: '/api/v2/search' // 搜索,语法借鉴ElasticSearch
|
|
|
}
|
|
|
};
|
|
|
|
|
@ -111,4 +138,5 @@ const pages = {
|
|
|
};
|
|
|
|
|
|
module.exports.PAGES = pages;
|
|
|
module.exports.APIv1 = APIv1;
|
|
|
module.exports.APIv1 = APIv1;
|
|
|
module.exports.APIv2 = APIv2;
|