import request from "@/utils/request";

/**
 * 获取操作日志列表
 * @param {Object} params 查询参数
 * @param {number} params.page 页码
 * @param {number} params.pageSize 每页数量
 * @param {string} params.keyword 关键词搜索
 * @param {string} params.module 模块筛选
 * @param {string} params.action 操作动作筛选
 * @param {string} params.status 状态筛选
 * @param {string} params.startTime 开始时间
 * @param {string} params.endTime 结束时间
 * @returns {Promise}
 */
export function getOperationLogs(params) {
  return request({
    url: "/platform/operationLogs",
    method: "get",
    params,
  });
}

/**
 * 获取操作日志详情
 * @param {number|string} id 日志ID
 * @returns {Promise}
 */
export function getOperationLogDetail(id) {
  return request({
    url: `/platform/operationLogs/${id}`,
    method: "get",
  });
}

/**
 * 删除操作日志
 * @param {number|string} id 日志ID
 * @returns {Promise}
 */
export function deleteOperationLog(id) {
  return request({
    url: `/platform/operationLogs/${id}`,
    method: "delete",
  });
}

/**
 * 批量删除操作日志
 * @param {Array} ids 日志ID数组
 * @returns {Promise}
 */
export function batchDeleteOperationLogs(ids) {
  return request({
    url: "/platform/operationLogs/batchDelete",
    method: "post",
    data: { ids },
  });
}

/**
 * 获取操作统计信息
 * @returns {Promise}
 */
export function getOperationStatistics() {
  return request({
    url: "/platform/operationLogs/statistics",
    method: "get",
  });
}