You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

chatService.ts 878B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import api from '@/utils/api';
  2. import registerServer from '@/utils/registerServer';
  3. import request from '@/utils/request';
  4. const {
  5. getDialog,
  6. setDialog,
  7. listDialog,
  8. getConversation,
  9. setConversation,
  10. completeConversation,
  11. listConversation,
  12. } = api;
  13. const methods = {
  14. getDialog: {
  15. url: getDialog,
  16. method: 'get',
  17. },
  18. setDialog: {
  19. url: setDialog,
  20. method: 'post',
  21. },
  22. listDialog: {
  23. url: listDialog,
  24. method: 'get',
  25. },
  26. listConversation: {
  27. url: listConversation,
  28. method: 'get',
  29. },
  30. getConversation: {
  31. url: getConversation,
  32. method: 'get',
  33. },
  34. setConversation: {
  35. url: setConversation,
  36. method: 'post',
  37. },
  38. completeConversation: {
  39. url: completeConversation,
  40. method: 'post',
  41. },
  42. } as const;
  43. const chatService = registerServer<keyof typeof methods>(methods, request);
  44. export default chatService;