import { http } from './http'

const urgeApi = {
  /**
   * 查询督学模式列表
   */
  getInspectorModeList: () => {
    return http.request({
      url: '/inspectorStudent/inspectorModeList',
    })
  },

  /**
   * 查询督学服务课表信息
   */
  getUserInspectorCourseList: () => {
    return http.request({
      url: '/inspectorStudent/userInspectorCourseList',
    })
  },

  /**
   * 查询督学订单列表
   */
  getUserInspectorOrderList: () => {
    return http.request({
      url: '/inspectorStudent/userInspectorOrderList',
    })
  },

  /*
   * 查询当前学生最后一次课时信息
   */
  getLastInspectorCourseInfo: () => {
    return http.request({
      url: '/inspectorStudent/lastInspectorCourseInfo',
    })
  },

  /*
   * 根据督学计划id查询学习计划信息
   */
  getInspectorPlanInfo: (inspectorPlanId: number) => {
    return http.request({
      url: '/inspectorStudent/inspectorPlanInfo',
      params: { inspectorPlanId },
    })
  },

  /**
   * 根据订单id查询最近或最后一次课时督学师和同学信息
   */
  getInspectorTeacherStudentInfo: (orderId: number) => {
    return http.request({
      url: '/inspectorStudent/inspectorTeacherStudentInfo',
      params: { orderId },
    })
  },

  /**
   * 查询当前学生督学课程报告列表
   */
  getUserInspectorCourseReportList: () => {
    return http.request({
      url: '/inspectorStudent/userInspectorCourseReportList',
    })
  },

  /**
   * 查询历史统计报告信息
   */
  getUserHistoryStatisticsReportInfo: () => {
    return http.request({
      url: '/inspectorStudent/userHistoryStatisticsReportInfo',
    })
  },

  /**
   * 根据督学课时id查询督学师和同学信息
   */
  getInspectorTeacherStudentInfoByInspectorCourseId: (inspectorCourseId: number) => {
    return http.request({
      url: '/inspectorStudent/inspectorTeacherStudentInfoByInspectorCourseId',
      params: { inspectorCourseId },
    })
  },

  /**
   * 根据课时id查询学生督学课程报告信息
   */
  getUserInspectorCourseReportInfo: (inspectorCourseId: number) => {
    return http.request({
      url: '/inspectorStudent/userInspectorCourseReportInfo',
      params: { inspectorCourseId },
    })
  },

  /**
   * 查询学生今日督学计划
   */
  getUserTodayInspectorPlanInfo: () => {
    return http.request({
      url: '/inspectorStudent/userTodayInspectorPlanInfo',
    })
  },

  /**
   * 发送沟通消息
   */
  sendInspectorTalkRecord: (params: anyObj) => {
    return http.request({
      url: '/inspectorStudent/sendInspectorTalkRecord',
      method: 'post',
      data: params,
    })
  },

  /**
   * 根据督学计划id查询沟通记录(分页)
   */
  getInspectorTalkRecordPage: (params: anyObj) => {
    return http.request({
      url: '/inspectorStudent/inspectorTalkRecordPage',
      params,
    })
  },

  /**
   * 已读消息
   */
  readTalkRecord: (params: anyObj) => {
    return http.request({
      url: '/inspectorStudent/readTalkRecord',
      method: 'post',
      data: params,
    })
  },

  /**
   * 查询督学模式按钮数据
   */
  getInspectorButtonData: () => {
    return http.request({
      url: '/inspectorStudent/inspectorButtonData',
    })
  },

  /**
   * 云督学计划任务表-id查询
   */
  getInspectorPlanTask: (id: any) => {
    return http.request({
      url: `/inspectorPlanTask/${id}`,
    })
  },

  // 学科章节-视频表-id查询
  getChapterVideoById: (params: anyObj) => {
    return http.request({
      url: `/subjectChapterVideo/getInfo`,
      params,
    })
  },
}

export default urgeApi
