import request from '@/utils/request'

// 查询个人页列表
export function listPersonal(query) {
  return request({
    url: '/system/personal/page/list',
    method: 'get',
    params: query
  })
}

// 查询个人页详细
export function getPersonal(id) {
  return request({
    url: '/system/personal/page/' + id,
    method: 'get'
  })
}

// 新增个人页
export function addPersonal(data) {
  return request({
    url: '/system/personal/page',
    method: 'post',
    data: data
  })
}

// 修改个人页
export function updatePersonal(data) {
  return request({
    url: '/system/personal/page',
    method: 'put',
    data: data
  })
}

// 删除个人页
export function delPersonal(id) {
  return request({
    url: '/system/personal/page/' + id,
    method: 'delete'
  })
}

// 导出个人页
export function exportPersonal(query) {
  return request({
    url: '/system/personal/page/export',
    method: 'get',
    params: query
  })
}
// 是否启用修改
export function changeEnable(id, enable) {
  const data = {
    id,
    enable
  }
  return request({
    url: '/system/personal/page/changeEnable',
    method: 'put',
    data: data
  })
}

// 个人头像上传
export function uploadAvatar(data) {
  return request({
    url: '/system/personal/page/avatar',
    method: 'post',
    data: data
  })
}