import request from '@/utils/request'


export function getTask(taskId) {
  return request({
    url: '/common/getTask/'+taskId,
    method: 'get'
  })
}

export function getSignature() {
    return request({
      url: '/common/getSignature',
      method: 'post',
    })
  }

export function uploadHuaWeiVod(file) {
  const formData = new FormData();
  formData.append('file', file);

  return request({
    url: '/hwcloud/uploadHuaWeiVod',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

export function uploadHuaWeiObs(file, progressCallback) {
  const formData = new FormData();
  formData.append('file', file);
  return request({
    url: '/hwcloud/uploadHuaWeiObs',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  });
}

export function cdnStatistics(query) {
  return request({
    url: '/hwcloud/cdnStatistics',
    method: 'get',
    params:query
  })
}

export function getTmpSecretKey(query) {
  return request({
    url: '/common/getTmpSecretKey',
    method: 'get',
    params:query
  })
}
