import request from '@/utils/request'

// 查询收货地址列表
export function listAddress(query) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.unimall.marketReceivingAddress',
      _mt: 'list',
      ...query
    }
  })
}

// 查询收货地址详细
export function getAddress(id) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.unimall.marketReceivingAddress',
      _mt: 'get',
      id: id
    }
  })
}

// 新增收货地址
export function addAddress(data) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.unimall.marketReceivingAddress',
      _mt: 'add',
      marketReceivingAddress: data
    }
  })
}

// 修改收货地址
export function updateAddress(data) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.unimall.marketReceivingAddress',
      _mt: 'update',
      marketReceivingAddress: data
    }
  })
}

// 删除收货地址
export function delAddress(id) {
  return request({
    method: 'post',
    params: {
      _gp: 'admin.unimall.marketReceivingAddress',
      _mt: 'delete',
      id: id
    }
  })
}

// 导出收货地址
export function exportAddress(query) {
  return request({
    method: 'get',
    params: {
      _gp: 'admin.unimall.marketReceivingAddress',
      _mt: 'export',
      ...query
    }
  })
}
