import request from '@/utils/request'

/* 查询知识库列表 */
export function listBuckets(data) {
  return request({
    url: '/kbm/selectBucketInfo', // '/minio/listBuckets',
    method: 'post',
    data
  })
}

/* 新增知识库 */
export function createBucket(data) {
  return request({
    url: '/minio/createBucket',
    method: 'post',
    data
  })
}

/* 编辑知识库  */
export function updateKbm(data) {
  return request({
    url: '/kbm/updateKbm',
    method: 'post',
    data
  })
}

/* 删除知识库  kbm/deleteBucket*/
export function deleteBucket(data) {
  return request({
    url: '/kbm/deleteBucket',
    method: 'post',
    data
  })
}

/* 获取指定的内部信息*/

export function getBucketContents(data) {
  return request({
    url: '/kbm/getFileInfo',
    method: 'post',
    data
  })
}

/* 删除内部文件 */

export function deleteFile(data) {
  return request({
    url: '/kbm/deleteDocument',
    method: 'post',
    data
  })
}

/* 下载  */

export function nameGetUrl(data) {
  return request({
    url: '/kbm/getUrl',
    method: 'post',
    data
  })
}

/* 上传 */

export function postUpload(data) {
  return request({
    url: '/minio/post',
    method: 'post',
    data
  })
}

/* 修改文档名称 /minio/renameFile */
export function renameFile(data) {
  return request({
    url: '/kbm/updateName',
    method: 'post',
    data
  })
}

/* 解析方法 /kbm/analysis */
export function analysis(data) {
  return request({
    url: '/kbm/analysis',
    method: 'post',
    data
  })
}
/* 文本信息 /kbm/searchTaskInfo */
export function searchTaskInfo(data) {
  return request({
    url: '/kbm/searchTaskInfo',
    method: 'post',
    data
  })
}

/* /kbm/batchAnalysis  批量解析 */
export function batchAnalysis(data) {
  return request({
    url: '/kbm/batchAnalysis',
    method: 'post',
    data
  })
}
/* 获取类型 */

export function getSuffixName(data) {
  return request({
    url: '/kbm/getSuffixName',
    method: 'post',
    data
  })
}

/* 通过id查询状态 /kbm/getRunStatus */

export function getRunStatus(data) {
  return request({
    url: '/kbm/getRunStatus',
    method: 'post',
    data
  })
}

/* 目录列表 */
export function selectTypeList(data) {
  return request({
    url: '/docType/selectTypeList',
    method: 'post',
    data
  })
}

/* 新增目录 */

export function insertType(data) {
  return request({
    url: '/docType/insertType',
    method: 'post',
    data
  })
}

/* 编辑目录 */

export function updateType(data) {
  return request({
    url: '/docType/updateType',
    method: 'post',
    data
  })
}
/* 查看目录 */

export function Info(data) {
  return request({
    url: '/docType/Info',
    method: 'post',
    data
  })
}

/* 删除目录 */

export function deleteType(data) {
  return request({
    url: '/docType/delete',
    method: 'post',
    data
  })
}

/* 批量移动目录 */

export function batchMove(data) {
  return request({
    url: '/kbm/batchMove',
    method: 'post',
    data
  })
}

/* docType/selectType0 */

export function selectType0(data) {
  return request({
    url: '/docType/selectType0',
    method: 'post',
    data
  })
}

/* 获取模型列表 */

export function modelList(data) {
  return request({
    url: 'model/search',
    method: 'post',
    data
  })
}

/* 生成应用  chatbot/configSave */

export function configSave(data) {
  return request({
    url: 'chatbot/configSave/',
    method: 'post',
    data
  })
}

/* 查询配置列表 */

export function configList(data) {
  return request({
    url: '/chatbot/configuration/list/',
    method: 'post',
    data
  })
}

/* 删除 */

export function configDelete(data) {
  return request({
    url: '/chatbot/configuration/delete/',
    method: 'post',
    data
  })
}
/* 获取模型列表 */

/* export function modelList(data) {
  return request({
    url: 'model-provider/search',
    method: 'post',
    data
  })
} */

/* 获取首页知识库分类汇总 */

export function structure_count(data) {
  return request({
    url: '/knowledgebase/structure_count/',
    method: 'post',
    data
  })
}

/* 获取首页文档信息 */
export function concle_count(data) {
  return request({
    url: '/knowledgebase/concle_count/',
    method: 'post',
    data
  })
}

/* 应用配置类型 */
export function application_types(data) {
  return request({
    url: '/chatbot/application-types/',
    method: 'post',
    data
  })
}

/* 设置为默认 /chatbot/configuration/set_default/ */

export function set_default(data) {
  return request({
    url: '/chatbot/configuration/set_default/',
    method: 'post',
    data
  })
}

/* 获取默认id值 */
export function get_default(data) {
  return request({
    url: 'chatbot/configuration/get_default/',
    method: 'get',
    data
  })
}

/* 批量删除 */

export function delDocumentList(data) {
  return request({
    url: 'kbm/delDocumentList',
    method: 'post',
    data
  })
}

/* 获取GPU数据 /machines/gpu-info/*/

export function gpu_info(data) {
  return request({
    url: '/machines/gpu-info/',
    method: 'get',
    data
  })
}

/* 列表 literature-data/list/ */

export function GET_list(data) {
  return request({
    url: 'literature-data/list/',
    method: 'post',
    data
  })
}

/* /literature-data/sync/ */

export function GET_sync(data) {
  return request({
    url: '/literature-data/sync/',
    method: 'post',
    data
  })
}

/* mq利用率 */

export function GET_Rbq(data) {
  return request({
    url: '/rabbitmq/info/',
    method: 'get',
    data
  })
}

/* 获取解析进度 */

export function getdocpro(data) {
  return request({
    url: '/kbm/getdocpro',
    method: 'post',
    data
  })
}
/* 单个处理任务监听 */
export function resultTask(data) {
  return request({
    url: `tasks/result/?document_id=${data}`,
    method: 'get'
  })
}
/* 文献处理 */
export function literResult(data) {
  return request({
    url: `tasks/literResult/?literature_id=${data}`,
    method: 'get'
  })
}

/* 获取解析结果  */

export function getDetail(data) {
  return request({
    url: '/literature-data/detail/',
    method: 'post',
    data
  })
}

/* 新增标签 */

export function add_tags(data) {
  return request({
    url: '/literature-tags/add_tags/',
    method: 'post',
    data
  })
}

/* 获取标签 */

export function get_literature_tags(data) {
  return request({
    url: '/literature-tags/get_literature_tags/',
    method: 'get',
    data
  })
}

/* 删除 */

export function remove_tags(data) {
  return request({
    url: '/literature-tags/remove_tags/',
    method: 'post',
    data
  })
}

/* 搜索 */

export function search_tags(data) {
  return request({
    url: '/literature-tags/search_tags/',
    method: 'post',
    data
  })
}

/* 编辑  */

export function edit_tags(data) {
  return request({
    url: '/literature-tags/edit_tags/',
    method: 'post',
    data
  })
}

/* 文献搜索 */

export function search(data) {
  return request({
    url: '/literature-data/search/',
    method: 'post',
    data
  })
}

/* 保存配置 */

export function saveConfig(data) {
  return request({
    url: '/project-prompt/save',
    method: 'post',
    data
  })
}

/* 获取配置列表 */
export function listProConfig(data) {
  return request({
    url: '/project-prompt/list',
    method: 'get',
    data
  })
}

/* 更新配置 project-prompt/update*/

export function updateConfig(data) {
  return request({
    url: 'project-prompt/update',
    method: 'post',
    data
  })
}

/* 删除配置 */

export function deleteConfig(data) {
  return request({
    url: 'project-prompt/delete',
    method: 'post',
    data
  })
}

/* 批量解析新   kbm/analysisPro*/

export function analysisPro(data) {
  return request({
    url: '/kbm/analysisPro',
    method: 'post',
    data
  })
}

/* 生成问答对 */
export function generateQa(data) {
  return request({
    url: '/kbm/generate-qa',
    method: 'post',
    data
  })
}

/* 文献点位列表 */

export function rawSearch(data) {
  return request({
    url: '/project-raw-data/search',
    method: 'post',
    data
  })
}

/* 导出  /project-raw-data/export-template*/

export function export_template(data) {
  return request({
    url: '/project-raw-data/export-template',
    method: 'get',
    data
  })
}

/* 导入 /project-raw-data/import  */

export function rawImport(data) {
  return request({
    url: '/project-raw-data/import',
    method: 'post',
    data
  })
}

/* 获取列表 */

export function rawList(data) {
  return request({
    url: '/project-raw-data/search',
    method: 'post',
    data
  })
}

/* 文献项目输入列表 project-input/list */

export function projectList(data) {
  return request({
    url: 'project-input/search',
    method: 'post',
    data
  })
}

/* 根据模板id搜索输入信息表*/
export function projectListFromTemplate(data) {
  return request({
    url: '/template/get_tech_report_locations',
    method: 'post',
    data,
    timeout: 0
  })
}

/* 新增文献项目 project-input/add*/

export function projectAdd(data) {
  return request({
    url: 'project-input/add',
    method: 'post',
    data
  })
}

/* 获取部门 project-input/departments */

export function departments(data) {
  return request({
    url: 'project-input/departments',
    method: 'get',
    data
  })
}

/* 修改 */

export function projectUpdate(data) {
  return request({
    url: 'project-input/update',
    method: 'post',
    data
  })
}

/* 删除  */

export function projectDelete(data) {
  return request({
    url: 'project-input/delete',
    method: 'post',
    data
  })
}

/* 动作类型   */

export function get_action_types(data) {
  return request({
    url: 'project-raw-data/get_action_types',
    method: 'post',
    data
  })
}

/* 批量文献处理 */

export function process_model_generation(data) {
  return request({
    url: 'liter-data-auto/process_model_generation',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: {
      literature_ids: data // 将传入的数据作为 literature_ids 的值
    }
  })
}
/* 重复处理文献 */
export function process_model_regeneration(data) {
  return request({
    url: 'liter-data-auto/process_model_regeneration',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data: {
      literature_ids: data // 将传入的数据作为 literature_ids 的值
    }
  })
}

/* 获取文献处理内容  */

export function result(data) {
  return request({
    url: '/literature-data/detail/',
    method: 'post',
    data
  })
}

/* 获取文件解析数量 */

export function doc_status(data) {
  return request({
    url: 'console/document-stats/',
    method: 'get',
    data
  })
}

/* 新建项目内容  */

export function create_items(data) {
  return request({
    timeout: 100000,
    url: 'project-input/create-items',
    method: 'post',
    data
  })
}

/* 删除项目  project-input/delete-items */

export function delete_items(data) {
  return request({
    timeout: 100000,
    url: 'project-input/delete-items',
    method: 'post',
    data
  })
}

/* 更新项目 project-input/update-items */

export function update_items(data) {
  return request({
    timeout: 100000,
    url: 'project-input/update-items',
    method: 'post',
    data
  })
}

/* 模糊查找文档 documents/search */

export function vague_search(data) {
  return request({
    url: 'documents/search',
    method: 'post',
    data
  })
}

/* 修改序号  */

export function sequence(data) {
  return request({
    url: 'project-input/sequence',
    method: 'post',
    data
  })
}

/* 输入项目打分 */
export function rateScope(data) {
  return request({
    url: 'project-input/score',
    method: 'post',
    data
  })
}

/* 获取输入项目位置表  */

export function Templatelist(data) {
  return request({
    url: 'project-input/Templatelist',
    method: 'post',
    data
  })
}

/* 修改模版排序 project-input-temp/update */
export function TemplateUpdate(data) {
  return request({
    url: 'project-input-temp/update',
    method: 'post',
    data
  })
}

/* 获取标签分类 */

export function categories(data) {
  return request({
    url: 'literature-tags/categories/',
    method: 'post',
    data
  })
}

/* 批量关联标签分类   */

export function categoriesUpdata(data) {
  return request({
    url: 'literature-tags/batch-update-category/',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    },
    data
  })
}

/* 模版内容更新  */

export function projectTemUpdate(data) {
  return request({
    url: 'project-input-temp/update-content',
    method: 'post',
    data
  })
}

/* task/clear/ */

export function endClear(data) {
  return request({
    url: 'task/clear/',
    method: 'post',
    data
  })
}

/* 获取SOTA数据  */

export function getSotaDetails(data) {
  return request({
    url: 'sota-details/search',
    method: 'post',
    data
  })
}

/* outcoms导出 sota-details/export_data_sota_details */

export function exportOutcoms(data) {
  return request({
    url: 'sota-details/export_data_sota_details',
    method: 'post',
    data
  })
}

/* 修改输入项目表信息 */

export function updateInfo(data) {
  return request({
    url: 'project-input-temp/update-info',
    method: 'post',
    data
  })
}

/* 批量修改部门 */
export function batchUpdateInfo(data) {
  return request({
    url: 'project-input-temp/batch-update-department',
    method: 'post',
    data
  })
}

/* 终止任务 */
export function literEndClear(data) {
  return request({
    url: '/liter-data-auto/terminate-processing',
    method: 'post',
     headers: {
      'Content-Type': 'application/json'
    },
    data: {
      literature_ids: data // 将传入的数据作为 literature_ids 的值
    }
  })
}

/* 获取进度 */
export function getProgress(data) {
  return request({
    url: `/api/literature/progress/?literature_ids=${data}`,
    method: 'get',
    data
  })
}