import request from '@/utils/request'

// 查询查询院校列表
export function listUniversity(query) {
  return request({
    url: '/front/university/list',
    method: 'get',
    params: query
  })
}

// 查询机构校区列表
export function listCampusSchoolList(query) {
  return request({
    url: '/dz/school/getCampusSchoolList',
    method: 'get',
    params: query
  })
}

// 查询机构校区列表
export function listAllSchool(query) {
  return request({
    url: '/dz/school/getSchoolList',
    method: 'get',
    params: query
  })
}
// 查询机构校区列表
export function listSchool(query) {
  return request({
    url: '/dz/school/list',
    method: 'get',
    params: query
  })
}

// 查询机构校区详细
export function getSchool(id) {
  return request({
    url: '/dz/school/' + id,
    method: 'get'
  })
}

// 新增机构校区
export function addSchool(data) {
  return request({
    url: '/dz/school',
    method: 'post',
    data: data
  })
}

// 修改机构校区
export function updateSchool(data) {
  return request({
    url: '/dz/school',
    method: 'put',
    data: data
  })
}

// 删除机构校区
export function delSchool(id) {
  return request({
    url: '/dz/school/' + id,
    method: 'delete'
  })
}

// 校验学校名称是否唯一
export function checkSchoolName(name, id) {
  return request({
    url: '/dz/school/checkSchoolName',
    method: 'get',
    params: { name, id }
  })
}

// 获取所有学校列表（不分页）
export function getAllSchool() {
  return request({
    url: '/dz/school/getAllSchool',
    method: 'get'
  })
}
