index.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. updateConversationPinned: async (data: any) => {
  24. return await request.put({
  25. url: '/promotion/kefu-conversation/update-conversation-pinned',
  26. data
  27. })
  28. },
  29. // 删除客服会话
  30. deleteConversation: async (id: number) => {
  31. return await request.get({ url: '/promotion/kefu-conversation/delete?id' + id })
  32. }
  33. }