import http from '@/utils/request'

export function getProjectList (params) {
  return http.post('/platform/project', { data: params })
}
export function updateProject (params) {
  return http.post('/platform/project/update', { data: params })
}
export function getProjectHeartbeat (params) {
  return http.post('/platform/project/getProjectHeartbeat', { data: params })
}
export function addProject (params) {
  return http.post('/platform/project/add', { data: params })
}

export function getOtaSourceList (params) {
  return http.post('/platform/otaSource', { data: params })
}
export function updateOtaSource (params) {
  return http.post('/platform/otaSource/update', { data: params })
}
export function deleteOtaSource (id) {
  const params = {
    idList: [id]
  }
  return http.post('/platform/otaSource/delete', { data: params })
}
export function addOtaSource (params) {
  return http.post('/platform/otaSource/add', { data: params })
}
export function getOtaProductList (params) {
  return http.post('/platform/otaProduct', { data: params })
}
export function getOtaProductById (params) {
  return http.post('/platform/otaProduct/getById', { data: params })
}
export function getOrderList (params) {
  return http.post('/platform/order/list', { data: params })
}
export function getOrderById (params) {
  return http.post('/platform/order/getById', { data: params })
}
export function getPlatformOrderStatistics (params) {
  return http.post('/platform/order/statistics', { data: params })
}
export function getUploadFileList (params) {
  return http.post('/platform/publicUploadFile', { data: params })
}
export function updateUploadFile (params) {
  return http.post('/platform/publicUploadFile/update', { data: params })
}
export function deleteUploadFile (id) {
  const params = {
    idList: [id]
  }
  return http.post('/platform/publicUploadFile/delete', { data: params })
}
export function addUploadFile (params) {
  return http.post('/platform/publicUploadFile/add', { data: params })
}
export function getSystemConfigList (params) {
  return http.post('/platform/system-config/list', { data: params })
}
export function updateSystemConfig (params) {
  return http.post('/platform/system-config/update', { data: params })
}
export function getSystemConfigByKey (params) {
  return http.post('/platform/system-config/getByConfigKey', { data: params })
}
export function deleteCache (params) {
  return http.post('/platform/cache/delete', { data: params })
}
export function uploadFile (params) {
  return http.post('/platform/file/upload', { data: params })
}

// 携程账号信息管理
export function getXcAccountList () {
  return http.post('/platform/xcAccountParam', {})
}
export function addXcAccount (params) {
  return http.post('/platform/xcAccountParam/add', { data: params })
}
export function updateXcAccount (params) {
  return http.post('/platform/xcAccountParam/update', { data: params })
}
export function deleteXcAccount (params) {
  return http.post('/platform/xcAccountParam/delete', { data: params })
}
