114 lines
1.9 KiB
JavaScript
114 lines
1.9 KiB
JavaScript
import request from '@/utils/request'
|
|
|
|
/**
|
|
* 获取查询请求的所有检索结果
|
|
*/
|
|
export function getSearchResults(inquiryId) {
|
|
return request({
|
|
url: `/search-results/inquiry/${inquiryId}`,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 更新检索结果项
|
|
*/
|
|
export function updateSearchResult(id, data) {
|
|
return request({
|
|
url: `/search-results/${id}`,
|
|
method: 'put',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 批量更新检索结果
|
|
*/
|
|
export function batchUpdateSearchResults(data) {
|
|
return request({
|
|
url: '/search-results/batch',
|
|
method: 'put',
|
|
data
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 标记为错误并删除
|
|
*/
|
|
export function deleteSearchResult(id) {
|
|
return request({
|
|
url: `/search-results/${id}`,
|
|
method: 'delete'
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 设置是否纳入回复参考资料
|
|
*/
|
|
export function setIncludeInResponse(id, include) {
|
|
return request({
|
|
url: `/search-results/${id}/include`,
|
|
method: 'post',
|
|
params: { include }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 设置是否需要下载全文
|
|
*/
|
|
export function setNeedDownload(id, need) {
|
|
return request({
|
|
url: `/search-results/${id}/download`,
|
|
method: 'post',
|
|
params: { need }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取所有待下载的结果项
|
|
*/
|
|
export function getPendingDownloads() {
|
|
return request({
|
|
url: '/download-tasks/pending',
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 获取查询请求的待下载结果项
|
|
*/
|
|
export function getPendingDownloadsByInquiry(inquiryId) {
|
|
return request({
|
|
url: `/download-tasks/inquiry/${inquiryId}/pending`,
|
|
method: 'get'
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 标记下载完成
|
|
*/
|
|
export function markDownloadComplete(id, filePath) {
|
|
return request({
|
|
url: `/download-tasks/${id}/complete`,
|
|
method: 'post',
|
|
params: { filePath }
|
|
})
|
|
}
|
|
|
|
/**
|
|
* 标记下载失败
|
|
*/
|
|
export function markDownloadFailed(id, reason) {
|
|
return request({
|
|
url: `/download-tasks/${id}/fail`,
|
|
method: 'post',
|
|
params: { reason }
|
|
})
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|