import request from '@/utils/request'

// 查询用户地址列表
export function listUserAddress(query) {
  return request({
    url: '/his/userAddress/list',
    method: 'get',
    params: query
  })
}

// 查询用户地址详细
export function getUserAddress(addressId) {
  return request({
    url: '/his/userAddress/' + addressId,
    method: 'get'
  })
}
export function getAddress(address) {
  return request({
    url: '/his/userAddress/getAddress/' + address,
    method: 'get'
  })
}

// 新增用户地址
export function addUserAddress(data) {
  return request({
    url: '/his/userAddress',
    method: 'post',
    data: data
  })
}

// 修改用户地址
export function updateUserAddress(data) {
  return request({
    url: '/his/userAddress',
    method: 'put',
    data: data
  })
}

// 删除用户地址
export function delUserAddress(addressId) {
  return request({
    url: '/his/userAddress/' + addressId,
    method: 'delete'
  })
}

// 导出用户地址
export function exportUserAddress(query) {
  return request({
    url: '/his/userAddress/export',
    method: 'get',
    params: query
  })
}