index.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import request from '@/config/axios'
  2. export interface KeFuConversationRespVO {
  3. id: number // 编号
  4. userId: number // 会话所属用户
  5. userAvatar: string // 会话所属用户头像
  6. userNickname: string // 会话所属用户昵称
  7. lastMessageTime: Date // 最后聊天时间
  8. lastMessageContent: string // 最后聊天内容
  9. lastMessageContentType: number // 最后发送的消息类型
  10. adminPinned: boolean // 管理端置顶
  11. userDeleted: boolean // 用户是否可见
  12. adminDeleted: boolean // 管理员是否可见
  13. adminUnreadMessageCount: number // 管理员未读消息数
  14. createTime?: string // 创建时间
  15. }
  16. // 客服会话 API
  17. export const KeFuConversationApi = {
  18. // 获得客服会话列表
  19. getConversationList: async () => {
  20. return await request.get({ url: '/promotion/kefu-conversation/list' })
  21. },
  22. // 获得客服会话
  23. getConversation: async (id: number) => {
  24. return await request.get({ url: `/promotion/kefu-conversation/get?id=` + id })
  25. },
  26. // 客服会话置顶
  27. updateConversationPinned: async (data: any) => {
  28. return await request.put({
  29. url: '/promotion/kefu-conversation/update-conversation-pinned',
  30. data
  31. })
  32. },
  33. // 删除客服会话
  34. deleteConversation: async (id: number) => {
  35. return await request.delete({ url: `/promotion/kefu-conversation/delete?id=${id}` })
  36. }
  37. }