import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/customer/list',
    method: 'get',
    params: query
  })
}

export function listAddress(query) {
  return request({
    url: '/address/list',
    method: 'get',
    params: query
  })
}

export function listCollect(query) {
  return request({
    url: '/collect/list',
    method: 'get',
    params: query
  })
}

export function listFeedback(query) {
  return request({
    url: '/feedback/list',
    method: 'get',
    params: query
  })
}

export function listFootprint(query) {
  return request({
    url: '/footprint/list',
    method: 'get',
    params: query
  })
}

export function listHistory(query) {
  return request({
    url: '/history/list',
    method: 'get',
    params: query
  })
}

export function read(id) {
  return request({
    url: '/customer/read',
    method: 'get',
    params: { id }
  })
}

export function detail(id) {
  return request({
    url: '/customer/detail',
    method: 'get',
    params: { id }
  })
}


export function findCustomerByMobile(mobile) {
  return request({
    url: '/customer/find',
    method: 'get',
    params: { mobile }
  })
}
export function findOrAdd(mobile) {
  return request({
    url: '/customer/findOrAdd',
    method: 'get',
    params: { mobile }
  })
}