import service from '@/utils/request'

export const getAllDep = () => {
  return service({
    url: '/department/queryAllDep',
    method: 'get'
  })
}

export const getDepByStart = () => {
  return service({
    url: '/department/queryDepByStart',
    method: 'get'
  })
}

export const createDep = (data) => {
  return service({
    url: '/department/createDep',
    method: 'post',
    data
  })
}

export const updateDep = (data) => {
  return service({
    url: '/department/updateDep',
    method: 'put',
    data
  })
}

export const updateDepStatus = (data) => {
  return service({
    url: '/department/updateDepStatus',
    method: 'put',
    data
  })
}

export const updateUserDep = (data) => {
  return service({
    url: '/department/updateUserDep',
    method: 'put',
    data
  })
}

export const deleteDep = (data) => {
  return service({
    url: '/department/deleteDep/' + data,
    method: 'delete'
  })
}

export const fileUpload = (data) => {
  return service({
    url: '/department/filesUpload',
    method: 'post',
    data
  })
}

export const xia = (data) => {
  return service({
    url: '/project/projectFilesDownload',
    method: 'post',
    responseType: 'blob',
    data: data
  })
}
