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

/**
 * @name 语料库-条文溯源
 */
// 获取列表
export const getAnnoHomeList = (params: AnnoHome.ReqAnnoHomeParams) => {
  return http.get<ResPage<Clause.ClauseInfo>>(PORT1 + `/article/annotation/list`, params);
};

// 获取条文详情
export const getAnnoHomeDetail = (params: { id: number }) => {
  return http.get<DataAnno.Detail>(PORT1 + `/article/annotation/detail`, params);
};

// 获取详情条文属性
export const geDetailtAttribute = (params: { id: number }) => {
  return http.get<DataAnno.AttrList[]>(PORT1 + `/article/annotation/attribute/detail`, params);
};

// 获取详情标注信息
export const getDetailLabel = (params: { id: number }) => {
  return http.get<DataAnno.ResDetailLabel>(PORT1 + `/article/annotation/tag/detail`, params);
};

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