import request from '@/utils/request'

// 查询学生班级列表
export function listClasses(query) {
  return request({
    url: '/dz/classes/list',
    method: 'get',
    params: query
  })
}
// 根据学校查询班级
export function getClassesBySchoolId(query) {
  return request({
    url: '/dz/classes/getClassesBySchoolId',
    method: 'get',
    params: query
  })
}

// 根据校区查询班级
export function getClassesByCampusId(query) {
  return request({
    url: '/dz/classes/getClassesByCampusId',
    method: 'get',
    params: query
  })
}

export function listAllClass(query) {
  return request({
    url: '/dz/classes/listAll',
    method: 'get',
    params: query
  })
}

// 查询学生班级列表
export function listAllSchool(query) {
  return request({
    url: '/dz/classes/getSchoolList',
    method: 'get',
    params: query
  })
}

// 查询学生班级详细
export function getClasses(classId) {
  return request({
    url: '/dz/classes/' + classId,
    method: 'get'
  })
}

// 新增学生班级
export function addClasses(data) {
  return request({
    url: '/dz/classes',
    method: 'post',
    data: data
  })
}

// 修改学生班级
export function updateClasses(data) {
  return request({
    url: '/dz/classes',
    method: 'put',
    data: data
  })
}

// 删除学生班级
export function delClasses(classId) {
  return request({
    url: '/dz/classes/' + classId,
    method: 'delete'
  })
}

// 校验班级名称在同一学校下是否唯一
export function checkClassName(schoolId, name, classId) {
  return request({
    url: '/dz/classes/checkClassName',
    method: 'get',
    params: { schoolId, name, classId }
  })
}
