import request from '@/utils/request'

// 查询错误日志列表
export function listErrorLog(query) {
  return request({
    url: '/monitor/errorLog/list',
    method: 'get',
    params: query
  })
}

// 查询错误日志详细
export function getErrorLog(errorId) {
  return request({
    url: '/monitor/errorLog/' + errorId,
    method: 'get'
  })
}

// 处理错误
export function resolveError(data) {
  return request({
    url: '/monitor/errorLog/resolve',
    method: 'put',
    data: data
  })
}

// 批量处理错误
export function batchResolve(data) {
  return request({
    url: '/monitor/errorLog/batchResolve',
    method: 'put',
    data: data
  })
}

// 删除错误日志
export function delErrorLog(errorIds) {
  return request({
    url: '/monitor/errorLog/' + errorIds,
    method: 'delete'
  })
}

// 清空错误日志
export function cleanErrorLog() {
  return request({
    url: '/monitor/errorLog/clean',
    method: 'delete'
  })
}

// 获取未处理错误数量
export function getUnresolvedCount() {
  return request({
    url: '/monitor/errorLog/unresolved/count',
    method: 'get'
  })
}
