import apiClient from './client'

// 上传图片接口
export interface UploadImageResponse {
  url: string
}

// 上传 API
export const uploadApi = {
  // 上传图片到 OSS
  uploadImage: (file: File) => {
    const formData = new FormData()
    formData.append('file', file)
    return apiClient.post<UploadImageResponse>('/app/upload/image', formData, {
      headers: { 'Content-Type': 'multipart/form-data' }
    })
  }
}
