contact.ts 890 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * 组件相关接口
  3. */
  4. import {
  5. bluebookAiAgent,
  6. } from '@/xiaolanbenlib/api/index'
  7. import request from '@/xiaolanbenlib/module/axios.js'
  8. import { TContactItem } from '@/types/contact'
  9. // 置顶与取消置顶
  10. export const setContactToTop = (data: {
  11. contactId: number|string,
  12. isTop: boolean
  13. }) => {
  14. return request.put(`${bluebookAiAgent}api/v1/my/contact/top`, data)
  15. }
  16. // 搜索联系人列表--前端 需要根据已拉取的记录去重
  17. export const getContactList = (data: {
  18. pageSize: number,
  19. startId: string,
  20. keyword?: string,
  21. }) => {
  22. return request.get<{
  23. data?: TContactItem[]
  24. nextId?: string,
  25. totalCount?: number
  26. }>(`${bluebookAiAgent}api/v1/my/contacts`, {params: {
  27. ...data
  28. }})
  29. }
  30. // 删除联系人
  31. export const delContact = (contactId: string|number) => {
  32. return request.delete(`${bluebookAiAgent}api/v1/my/contact/${contactId}`)
  33. }