import http from '@/api'
/**
 * @name 查询对象存储配置列表
 * @param query 参数
 * @returns 返回列表
 */
export const listOssConfigApi = (query: any) => {
  return http.get<any>('/resource/oss/config/list', query, { loading: true })
}

/**
 * @name 查询对象存储配置详细
 * @param ossConfigId ossConfigId
 * @returns returns
 */
export const getOssConfigApi = (ossConfigId: any) => {
  return http.get<any>(`/resource/oss/config/${ossConfigId}`)
}

/**
 * @name 新增对象存储配置
 * @param data data
 * @returns returns
 */
export const addOssConfigApi = (data: any) => {
  return http.post<any>('/resource/oss/config', data, { loading: false })
}

/**
 * @name 修改对象存储配置
 * @param data data
 * @returns returns
 */
export const updateOssConfigApi = (data: any) => {
  return http.put<any>('/resource/oss/config', data, { loading: false })
}
/**
 * @name 对象存储状态修改
 * @param data data
 * @returns returns
 */
export const changeOssConfigStatusApi = (data: any) => {
  return http.put<any>('/resource/oss/config/changeStatus', data, { loading: false })
}

/**
 * @name 删除对象存储配置
 * @param ossConfigId ossConfigId
 * @returns returns
 */
export const delOssConfigApi = (ossConfigId: any) => {
  return http.delete<any>(`/resource/oss/config/${ossConfigId}`)
}

/**
 * @name 下载模板
 * @returns returns
 */
export const importTemplateApi = () => {
  return http.downloadPost('/resource/oss/config/importTemplate', {})
}

/**
 * @name 导入数据
 * @returns returns
 */
export const importOssConfigDataApi = (data: any) => {
  return http.post('/resource/oss/config/importData', data)
}

/**
 * @name 导出数据
 * @returns returns
 */
export const exportOssConfigApi = (data: any) => {
  return http.downloadPost('/resource/oss/config/export', data)
}
