import request from '../utils/request'

/**
 * 上传图片到腾讯广告
 */
export function uploadImage(formData) {
  return request({
    timeout: 300000,
    url: '/api/tencent-images/upload',
    method: 'post',
    data: formData,
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  })
}

/**
 * 获取图片列表
 */
export function getImageList(params) {
  return request({
    url: '/api/tencent-images/list',
    method: 'get',
    params
  })
}

/**
 * 获取图片详情
 */
export function getImageDetail(id) {
  return request({
    url: `/api/tencent-images/${id}`,
    method: 'get'
  })
}

/**
 * 删除图片
 */
export function deleteImage(id) {
  return request({
    url: `/api/tencent-images/${id}`,
    method: 'delete'
  })
}
