import request from './request'

// 获取我的作品列表
export const getMyWorks = (params = {}) => {
  return request({
    url: '/works/my-works',
    method: 'GET',
    params: {
      page: params.page || 0,
      size: params.size || 10
    }
  })
}

// 获取作品详情
export const getWorkDetail = (workId) => {
  return request({
    url: `/works/${workId}`,
    method: 'GET'
  })
}

// 删除作品
export const deleteWork = (workId) => {
  return request({
    url: `/works/${workId}`,
    method: 'DELETE'
  })
}

// 批量删除作品
export const batchDeleteWorks = (workIds) => {
  return request({
    url: '/works/batch-delete',
    method: 'POST',
    data: {
      workIds: workIds
    }
  })
}

// 更新作品信息
export const updateWork = (workId, data) => {
  return request({
    url: `/works/${workId}`,
    method: 'PUT',
    data: data
  })
}

// 获取作品统计信息
export const getWorkStats = () => {
  return request({
    url: '/works/stats',
    method: 'GET'
  })
}





