import { request } from '@/service/request';

/** 获取院校招录专业历年录取数据列表 */
export function fetchGetSchoolRecruitMajorHistoryList(params?: Api.Art.SchoolRecruitMajorHistorySearchParams) {
  return request<Api.Art.SchoolRecruitMajorHistoryList>({
    url: '/art/schoolRecruitMajorHistory/list',
    method: 'get',
    params
  });
}
/** 新增院校招录专业历年录取数据 */
export function fetchCreateSchoolRecruitMajorHistory(data: Api.Art.SchoolRecruitMajorHistoryOperateParams) {
  return request<boolean>({
    url: '/art/schoolRecruitMajorHistory',
    method: 'post',
    data
  });
}

/** 修改院校招录专业历年录取数据 */
export function fetchUpdateSchoolRecruitMajorHistory(data: Api.Art.SchoolRecruitMajorHistoryOperateParams) {
  return request<boolean>({
    url: '/art/schoolRecruitMajorHistory',
    method: 'put',
    data
  });
}

/** 批量删除院校招录专业历年录取数据 */
export function fetchBatchDeleteSchoolRecruitMajorHistory(historyIds: CommonType.IdType[]) {
  return request<boolean>({
    url: `/art/schoolRecruitMajorHistory/${historyIds.join(',')}`,
    method: 'delete'
  });
}
