consulting-api.js 1.0 KB

123456789101112131415161718192021222324252627282930
  1. (function($){
  2. var consulting = {
  3. //创建会话
  4. createSession: function(data) {
  5. return httpRequest.imHttpPost("/sessions", {data: data})
  6. },
  7. //获取成员列表
  8. getParticipants:function(sessionId){
  9. return httpRequest.imHttpGet("/sessions/"+sessionId+"/participants", {data: {}})
  10. },
  11. //获取im消息
  12. getMessages:function(data){
  13. return httpRequest.imHttpGet("/sessions/"+data.session_id+"/messages",{data:data});
  14. },
  15. //发送消息
  16. sendMessage: function(sessionId, data){
  17. return httpRequest.imHttpPost('/sessions/'+sessionId+'/messages', data);
  18. },
  19. //上传图片
  20. uploadImage: function(data){
  21. return httpRequest.post('upload/chat', data);
  22. },
  23. //康复管理-保存指导留言
  24. saveGuidanceMessage: function(data){
  25. return httpRequest.post('doctor/specialist/rehabilitation/saveGuidanceMessage', {data:data});
  26. },
  27. };
  28. window.consultingAPI = consulting;
  29. })(jQuery)