import { ResPage, Retrieval, Clause } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";

/**
 * @name 检索
 */
// 获取列表
export const getRetrievalList = (params: Partial<Retrieval.ReqRetrievalParams>) => {
  return http.post<ResPage<Clause.ClauseInfo>>(PORT1 + `/search/common`, params);
};

// 条文内容检索悬浮弹窗
export const getCheckedListByKeyword = (params: { keyword: string }) => {
  return http.get<Retrieval.ResKeywordCheckedList>(PORT1 + `/search/keyword/info`, params);
};

// 条文撤回
export const revokeClause = (params: { id: number }) => {
  return http.post(PORT1 + `/article/revoke`, params);
};

// 导出
export const exportRetrieval = (params: { articleIds: string[] }) => {
  return http.download(PORT1 + `/article/first/excel/export`, params);
};
