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

/** 获取学校专业列表 */
export function fetchGetSchoolMajorList(params?: Api.Art.SchoolMajorSearchParams) {
  return request<Api.Art.SchoolMajorList>({
    url: '/art/schoolMajor/list',
    method: 'get',
    params
  });
}
/** 新增学校专业 */
export function fetchCreateSchoolMajor(data: Api.Art.SchoolMajorOperateParams) {
  return request<boolean>({
    url: '/art/schoolMajor',
    method: 'post',
    data
  });
}

/** 修改学校专业 */
export function fetchUpdateSchoolMajor(data: Api.Art.SchoolMajorOperateParams) {
  return request<boolean>({
    url: '/art/schoolMajor',
    method: 'put',
    data
  });
}

/** 批量删除学校专业 */
export function fetchBatchDeleteSchoolMajor(majorIds: CommonType.IdType[]) {
  return request<boolean>({
    url: `/art/schoolMajor/${majorIds.join(',')}`,
    method: 'delete'
  });
}
