index.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import request from '@/config/axios'
  2. // TODO @puhui999:注释要不放在属性后面,避免太长哈
  3. export interface KeFuConversationRespVO {
  4. /**
  5. * 编号
  6. */
  7. id: number
  8. /**
  9. * 会话所属用户
  10. */
  11. userId: number
  12. /**
  13. * 会话所属用户头像
  14. */
  15. userAvatar: string
  16. /**
  17. * 会话所属用户昵称
  18. */
  19. userNickname: string
  20. /**
  21. * 最后聊天时间
  22. */
  23. lastMessageTime: Date
  24. /**
  25. * 最后聊天内容
  26. */
  27. lastMessageContent: string
  28. /**
  29. * 最后发送的消息类型
  30. */
  31. lastMessageContentType: number
  32. /**
  33. * 管理端置顶
  34. */
  35. adminPinned: boolean
  36. /**
  37. * 用户是否可见
  38. */
  39. userDeleted: boolean
  40. /**
  41. * 管理员是否可见
  42. */
  43. adminDeleted: boolean
  44. /**
  45. * 管理员未读消息数
  46. */
  47. adminUnreadMessageCount: number
  48. /**
  49. * 创建时间
  50. */
  51. createTime?: string
  52. }
  53. // 客服会话 API
  54. export const KeFuConversationApi = {
  55. // 获得客服会话列表
  56. getConversationList: async () => {
  57. return await request.get({ url: '/promotion/kefu-conversation/list' })
  58. },
  59. // 客服会话置顶
  60. updateConversationPinned: async (data: any) => {
  61. return await request.put({
  62. url: '/promotion/kefu-conversation/update-conversation-pinned',
  63. data
  64. })
  65. },
  66. // 删除客服会话
  67. deleteConversation: async (id: number) => {
  68. return await request.get({ url: '/promotion/kefu-conversation/delete?id' + id })
  69. }
  70. }