import request from "@/utils/request";
import { method } from "lodash";

// 查询语料库列表
export function listCorpus(query) {
  return request({
    url: "/vi/corpus/single/list",
    method: "get",
    params: query,
  });
}

// 查询语料库详细
export function getCorpus(corpusId) {
  return request({
    url: "/vi/corpus/" + corpusId,
    method: "get",
  });
}

// 新增语料库
export function addCorpus(data) {
  return request({
    url: "/vi/corpus",
    method: "post",
    data: data,
  });
}

// 修改语料库
export function updateCorpus(data) {
  return request({
    url: "/vi/corpus",
    method: "put",
    data: data,
  });
}

// 删除语料库
export function delCorpus(corpusId) {
  return request({
    url: "/vi/corpus/" + corpusId,
    method: "delete",
  });
}

export function batchAddCorpus(data) {
  return request({
    url: "/vi/corpus/continuous/insert",
    method: "post",
    data: data,
  });
}

export function batchUpdateCorpus(data) {
  return request({
    url: "/vi/corpus/continuous/update",
    method: "post",
    data: data,
  });
}

export function getBatchCorpus(query) {
  return request({
    url: "/vi/corpus/continuous/list",
    method: "get",
    params: query,
  });
}

export function deleteBatchCorpus(corpusIds) {
  return request({
    url: `/vi/corpus/continuous`,
    method: "delete",
    data: corpusIds,
  });
}
