import request from '../utils/request'

const api = {
  DownloadCenter: '/Public/GetDownloadCenter',
  AdminDownloadList: '/Admin/Download/List',
  AdminDownload: '/Admin/Download',
  AdminDownloadVersionList: '/Admin/DownloadVersion/List',
  AdminDownloadVersion: '/Admin/DownloadVersion'
}

export function getDownloadCenter() {
  return request({ url: api.DownloadCenter, method: 'get' })
}

export function getAdminDownloadList(params) {
  return request({ url: api.AdminDownloadList, method: 'get', params })
}

export function saveAdminDownload(data) {
  return request({ url: api.AdminDownload, method: 'post', data })
}

export function deleteAdminDownload(data) {
  return request({ url: api.AdminDownload, method: 'delete', data })
}

export function getAdminDownloadVersionList(params) {
  return request({ url: api.AdminDownloadVersionList, method: 'get', params })
}

export function saveAdminDownloadVersion(data) {
  return request({ url: api.AdminDownloadVersion, method: 'post', data })
}

export function deleteAdminDownloadVersion(data) {
  return request({ url: api.AdminDownloadVersion, method: 'delete', data })
}
