import request from '@/utils/request'

// 查询用户关联列表
export function listRelation(query) {
  return request({
    url: '/user/relation/list',
    method: 'get',
    params: query
  })
}

// 查询用户关联详细
export function getRelation(relationId) {
  return request({
    url: '/user/relation/' + relationId,
    method: 'get'
  })
}

// 新增用户关联
export function addRelation(data) {
  return request({
    url: '/user/relation',
    method: 'post',
    data: data
  })
}

// 修改用户关联
export function updateRelation(data) {
  return request({
    url: '/user/relation',
    method: 'put',
    data: data
  })
}

// 删除用户关联
export function delRelation(relationId) {
  return request({
    url: '/user/relation/' + relationId,
    method: 'delete'
  })
}

// 导出用户关联
export function exportRelation(query) {
  return request({
    url: '/user/relation/export',
    method: 'get',
    params: query
  })
}
