import request from '@/utils/request'

// 查询短链课程看课记录列表
export function listCourseWatchLog(query) {
  return request({
    url: '/course/courseWatchLog/list',
    method: 'POST',
    data: query
  })
}

// 查询短链课程看课记录列表
export function listCourseWatchLogPage(query) {
  return request({
    url: '/course/courseWatchLog/pageList',
    method: 'post',
    data: query
  })
}

// 查询短链课程看课记录详细
export function getCourseWatchLog(logId) {
  return request({
    url: '/course/courseWatchLog/' + logId,
    method: 'get'
  })
}

// 新增短链课程看课记录
export function addCourseWatchLog(data) {
  return request({
    url: '/course/courseWatchLog',
    method: 'post',
    data: data
  })
}

// 修改短链课程看课记录
export function updateCourseWatchLog(data) {
  return request({
    url: '/course/courseWatchLog',
    method: 'put',
    data: data
  })
}

// 删除短链课程看课记录
export function delCourseWatchLog(logId) {
  return request({
    url: '/course/courseWatchLog/' + logId,
    method: 'delete'
  })
}

// 导出短链课程看课记录
export function exportCourseWatchLog(query) {
  return request({
    url: '/course/courseWatchLog/export',
    method: 'post',
    data: query
  })
}
//会员看课统计导出
export function exportCourseWatchLogStatisticsExport(query) {
  return request({
    url: '/course/courseWatchLog/statisticsExport',
    method: 'POST',
    data: query
  })
}



export function statisticsList(query) {
  return request({
    url: '/course/courseWatchLog/statisticsList',
    method: 'get',
    params: query
  })
}

export function qwWatchLogStatisticsList(query) {
  return request({
    url: '/course/courseWatchLog/qwWatchLogStatisticsList',
    method: 'get',
    params: query
  })
}

export function qwWatchLogAllStatisticsList(query) {
  return request({
    url: '/course/courseWatchLog/qwWatchLogAllStatisticsList',
    method: 'get',
    params: query
  })
}
export function myQwWatchLogStatisticsList(query) {
  return request({
    url: '/course/courseWatchLog/myQwWatchLogStatisticsList',
    method: 'get',
    params: query
  })
}
export function myQwWatchLogAllStatisticsList(query) {
  return request({
    url: '/course/courseWatchLog/myQwWatchLogAllStatisticsList',
    method: 'get',
    params: query
  })
}
export function watchLogStatistics(query) {
  return request({
    url: '/course/courseWatchLog/watchLogStatistics',
    method: 'get',
    params: query
  })
}

// 查询课程小结详情总体数据
export function getCourseStatisticsDetail(videoId, periodId) {
  return request({
    url: '/course/courseWatchLog/courseStatisticsDetail',
    method: 'get',
    params: {
      videoId: videoId,
      periodId: periodId
    }
  })
}

// 查询课程小结用户详情列表（分页）
export function getCourseStatisticsUserDetailList(params) {
  return request({
    url: '/course/courseWatchLog/courseStatisticsUserDetail',
    method: 'get',
    params: params
  })
}

// 导出课程小结用户详情（按创建时间倒序，最多50000条）
export function exportCourseStatisticsUserDetail(videoId, periodId) {
  return request({
    url: '/course/courseWatchLog/courseStatisticsUserDetailExport',
    method: 'get',
    params: { videoId, periodId }
  })
}

// 根据名称模糊查询用户列表app看课
export function getCustomerListLikeName(params) {
  return request({
    url: '/course/appCourseWatchLog/getCustomerListLikeName',
    method: 'get',
    params: params
  })
}
// 查询短链课程看课记录列表app看课
export function listAppCourseWatchLog(query) {
  return request({
    url: '/course/appCourseWatchLog/list',
    method: 'get',
    params: query
  })
}
// 导出短链课程看课记录app看课
export function exportAppCourseWatchLog(query) {
  return request({
    url: '/course/appCourseWatchLog/export',
    method: 'get',
    params: query
  })
}

// 批量修改好友备注
export function batchUpdateFriendRemark(data) {
  return request({
    url: '/course/appCourseWatchLog/batchUpdateFriendRemark',
    method: 'post',
    data: data
  })
}
