import request from '@/utils/request'

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

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

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

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

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

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

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