import http from '@/utils/http'

let baseUrl = '/resource'

//新增资源集
export function addResource(addForm) {
  return http.post(baseUrl + '/add', addForm)
}

//解析资源
export function analyseResource(file, type) {
  return http.post(baseUrl + '/analyse?type=' + type, file)
}

//解析资源
export function analyseAndImport(file, resourceId) {
  return http.post(baseUrl + '/analyse/' + resourceId, file)
}

//上传资源
export function importResource(importData) {
  return http.post(baseUrl + '/import', importData)
}

//更新草稿状态
export function editDraft(importData) {
  return http.post(baseUrl + '/edit-draft', importData)
}

//分页查询资源
export function getResourcePage(queryForm) {
  return http.post(baseUrl + '/page', queryForm)
}

//查看资源数据集基础信息
export function getBaseInfo(resourceId) {
  return http.get(baseUrl + '/base-info/' + resourceId)
}

//查询资源数据
export function getResourceData(resourceId) {

}

//删除数据集
export function deleteResource(resourceId) {
  return http.delete(baseUrl + '/' + resourceId)
}

//待选择资源
export function getNotAssignedList(projectId) {
  return http.get(baseUrl + '/not-assigned-list?projectId=' + projectId)
}
