import request from '@/utils/request'

// 导出AI对话会话
export function exportChatSessions(query) {
  return request({ url: '/admin/aiChatQuality/export', method: 'get', params: query })
}

// 查询AI聊天会话列表
export function listChatSessions(query) {
  return request({
    url: '/admin/aiChatQuality/sessions',
    method: 'get',
    params: query
  })
}

// 根据租户ID查询会话列表
export function listByCompany(companyId) {
  return request({
    url: '/admin/aiChatQuality/sessions',
    method: 'get',
    params: { companyId }
  })
}

// 获取会话详情
export function getSessionDetail(sessionId) {
  return request({
    url: '/admin/aiChatQuality/session/' + sessionId,
    method: 'get'
  })
}

// 获取会话消息列表
export function getSessionMessages(sessionId) {
  return request({
    url: '/admin/aiChatQuality/messages/' + sessionId,
    method: 'get'
  })
}

// 添加质检记录
export function addQualityRecord(data) {
  return request({
    url: '/admin/aiChatQuality/record',
    method: 'post',
    data: data
  })
}

// 查询质检记录列表
export function listQualityRecords(query) {
  return request({
    url: '/admin/aiChatQuality/records',
    method: 'get',
    params: query
  })
}

// 获取质检记录详情
export function getQualityRecord(id) {
  return request({
    url: '/admin/aiChatQuality/record/' + id,
    method: 'get'
  })
}

// 修改质检记录
export function updateQualityRecord(data) {
  return request({
    url: '/admin/aiChatQuality/record',
    method: 'put',
    data: data
  })
}

// 删除质检记录
export function deleteQualityRecord(id) {
  return request({
    url: '/admin/aiChatQuality/record/' + id,
    method: 'delete'
  })
}