const axios = require('@/common/axios').default
const apiPrefix = '/api-web'
import qs from 'qs'
import request from '@/helpers/request'
// 根据日期获取当日排课
const getCourseSchedulesWithDate = (data) => {
    return axios({
        url: apiPrefix + '/educationCourseSchedule/getCourseSchedulesWithDate',
        method: 'get',
        params: data
    })
}

// 获取老师
const findTeachers = (data) => {
    return axios({
        url: apiPrefix + '/teacher/findTeachers',
        method: 'get',
        params: data
    })
}

// 课程调整
const classStartDateAdjust = (data) => {
    return axios({
        url: apiPrefix + '/courseSchedule/classStartDateAdjust',
        method: 'post',
        data: qs.stringify(data)
    })
}

// 课程调整
const queryNameList = (data) => {
    return axios({
        url: apiPrefix + '/teacher/queryNameList',
        method: 'get',
        params: data
    })
}

// 课程调整
const courseSwap = (data) => {
    return axios({
        url: apiPrefix + '/educationCourseSchedule/courseSwap',
        method: 'post',
        data: qs.stringify(data)
    })
}

// 查询课程下学生考勤
const findStudentAttendance = (data) => {
    return axios({
        url: apiPrefix + '/eduStudentAttendance/findStudentAttendance',
        method: 'get',
        params: data
    })
}

// 查询最新协议
const queryProduceContract = (data) => {
    return axios({
      url: '/api-web/eduContracts/queryProduceContract',
      method: 'get',
      params: data
    })
}

// 查询VIP老师教学点
const findVipSchoolByTeacher = (data) => {
    return axios({
        url: apiPrefix + '/school/findVipSchoolByTeacher',
        method: 'get',
        params: data
    })
}

// 获取协议
const getContract = (data) => {
    return request({
        url: `/tenantInfo/getContract/${data.id}`,
        method: 'get',
        params: data
    })
}

export {
    getCourseSchedulesWithDate,
    findTeachers,
    classStartDateAdjust,
    queryNameList,
    courseSwap,
    findStudentAttendance,
    queryProduceContract,
    findVipSchoolByTeacher,
    getContract
}