import request from '/@/utils/request'

/**
 * 分页查询心理咨询预约师
 * @param query current, size, realName
 */
export const fetchList = (query?: any) => {
  return request({
    url: '/stuwork/psychologicalcounselingteacher/page',
    method: 'get',
    params: query
  })
}

/**
 * 获取预约师列表（不分页）
 */
export const getList = () => {
  return request({
    url: '/stuwork/psychologicalcounselingteacher/list',
    method: 'get'
  })
}

/**
 * 通过 id 查询详情
 * @param id
 */
export const getDetail = (id: string) => {
  return request({
    url: '/stuwork/psychologicalcounselingteacher/detail',
    method: 'get',
    params: { id }
  })
}

/**
 * 新增心理咨询预约师
 * @param data userName, realName, phone, remarks
 */
export const addObj = (data: any) => {
  return request({
    url: '/stuwork/psychologicalcounselingteacher',
    method: 'post',
    data
  })
}

/**
 * 修改心理咨询预约师
 * @param data id, userName, realName, phone, remarks
 */
export const editObj = (data: any) => {
  return request({
    url: '/stuwork/psychologicalcounselingteacher/edit',
    method: 'post',
    data
  })
}

/**
 * 通过 id 删除心理咨询预约师
 * @param ids id 数组
 */
export const delObj = (ids: string[]) => {
  return request({
    url: '/stuwork/psychologicalcounselingteacher/delete',
    method: 'post',
    data: ids
  })
}
