import request from '@/utils/request'

// 按周获取课表
export function searchListForCalendar(query) {
  return request({
    url: '/api/sc/cla/time/list/searchListForCalendar',
    method: 'get',
    params: query
  })
}

export function searchListForCalendarByMemberId(query) {
  return request({
    url: '/api/sc/cla/time/list/searchListForCalendarByMemberId',
    method: 'get',
    params: query
  })
}

// 获取最近几天的排课日程
export function searchRecentDayTimeList(query) {
  return request({
    url: '/api/sc/cla/time/list/searchRecentDayTimeList',
    method: 'get',
    params: query
  })
}

// 获取上课记录
export function selectListForAttend(query) {
  return request({
    url: '/api/sc/cla/time/list/selectListForAttend',
    method: 'get',
    params: query
  })
}

// 排课详细信息
export function claTimeInfo(courseTimeId) {
  return request({
    url: '/api/sc/cla/time/info/detailById/' + courseTimeId,
    method: 'get'
  })
}

// 新增
export function addTime(data) {
  return request({
    url: '/api/sc/cla/time/add/addScClaTime',
    method: 'post',
    data: data
  })
}

// 修改
export function updateTime(data) {
  return request({
    url: '/api/sc/cla/time/update/updateScClaTime',
    method: 'put',
    data: data
  })
}

// 删除
export function delTime(courseTimeId) {
  return request({
    url: '/api/sc/cla/time/delete/deleteById/' + courseTimeId,
    method: 'delete'
  })
}

// 上课
export function confirmCla(data) {
  return request({
    url: '/api/sc/cla/time/update/confirmCla',
    method: 'post',
    data: data
  })
}

// 课程 预约会员列表
export function searchCourseClaStudent(query) {
  return request({
    url: '/api/sc/cla/time/list/searchCourseClaStudent',
    method: 'get',
    params: query
  })
}
