import client from './client'

export interface TenantOperationLog {
  id: string
  tenantId: string
  moduleType: string
  resourceType: string
  resourceId?: string
  action: string
  operator?: string
  detailJson?: string
  summary?: string
  ipAddress?: string
  createdAt: string
}

export interface PageResult<T> {
  content: T[]
  number: number
  size: number
  totalElements: number
  totalPages: number
  first: boolean
  last: boolean
}

export const operationLogApi = {
  list(params: { moduleType?: string; page?: number; size?: number }) {
    return client.get<{ data: PageResult<TenantOperationLog> }>('/operation-logs', { params })
  },
}
