import httpRequest from '@/utils/axios'

// 获取收藏列表
export function getCollectionList(params?: { type?: string; course_id?: string; semester_id?: string }) {
  return httpRequest.get('/api/saas/api/v1/collection/list', { params })
}

// 收藏/取消收藏
export function collectionResource(data: {
  course_id: string
  semester_id: string
  chapter_id: string
  section_id: string
  source_id: string
  type: number
  status: number
}) {
  return httpRequest.post('/api/saas/api/v1/collection/resource', data)
}

// 获取所有课程
export function getCourseList() {
  return httpRequest.get('/api/saas/api/v1/course/all')
}
