import request from '@/config/axios'

export interface ApiAccessLogVO {
  id: number
  traceId: string
  userId: number
  userType: number
  applicationName: string
  requestMethod: string
  requestParams: string
  responseBody: string
  requestUrl: string
  userIp: string
  userAgent: string
  operateModule: string
  operateName: string
  userNickName: string
  operateType: number
  beginTime: Date
  endTime: Date
  duration: number
  resultCode: number
  resultMsg: string
  createTime: Date
}

// 查询列表API 访问日志
export const getApiAccessLogPage = (params: PageParam) => {
  return request.get({ url: '/infra/api-access-log/page', params })
}

// 导出API 访问日志
export const exportApiAccessLog = (params) => {
  return request.download({ url: '/infra/api-access-log/export-excel', params })
}

// 查询列表API 门墩儿访问日志
export const getApiAccessLogMendunerPage = (params: PageParam) => {
  return request.get({ url: '/menduner/system/api-access-log/page', params })
}

// 导出API 门墩儿访问日志
export const exportApiAccessMendunerLog = (params: PageParam) => {
  return request.get({ url: '/menduner/system/api-access-log/export-excel', params })
}
