import { http } from './http'
import { get } from './request'

const studyAnalysisApi = {
  /**
   * 获取统计数据-学习时长统计
   */
  getReportDuration: (params: anyObj) => {
    return http.request({
      url: `/userSubjectReport/study/duration`,
      params,
    })
  },

  /**
   * 获取统计数据-错题本统计
   */
  getReportError: (params: anyObj) => {
    return http.request({
      url: `/userSubjectReport/study/error`,
      params,
    })
  },

  /**
   * 获取统计数据-知识图谱统计
   */
  getReportKnowledge: (params: anyObj) => {
    return http.request({
      url: `/userSubjectReport/study/knowledge`,
      params,
    })
  },

  /**
   * 获取统计数据-视频学习统计
   */
  getReportvideo: (params: anyObj) => {
    return http.request({
      url: `/userSubjectReport/study/video`,
      params,
    })
  },

  /**
   * 获取统计数据-英语语感练习
   */
  getStatListByTimeFlag: (data: anyObj) => {
    return http.request({
      url: `/userSentenceLearn/queryStatListByTimeFlag`,
      data,
      method: 'post',
    })
  },

  /**
   * 获取统计数据-单词学习统计
   */
  getWordReportData: (params: anyObj) => {
    return http.request({
      url: `/userSubjectReport/eng/word`,
      params,
    })
  },

  // 获取学员信息
  getUserInfoById: async (stuId: any): Promise<any> => {
    return await get(`/schoolUser/getInfo`, { stuId })
  },

  // 练习统计
  getTrainRecord: (params: anyObj) => {
    return http.request({
      url: `/userSubjectReport/study/trainRecord`,
      params,
    })
  },
}

export default studyAnalysisApi
