import type { LogEntity, PageConfig } from '@vben/types';

import { parseQueryValues } from '@vben/utils';

import { requestClient } from '#/api/request';

interface LogPartialEntity extends Partial<Omit<LogEntity, 'id'>> {
  id?: number;
}

interface LogQueryParams extends LogPartialEntity, PageConfig {}

/**
 * 日志信息_列表
 */
export async function getLogListApi(params: LogQueryParams) {
  return requestClient.post<any>('/api/query/list?pagevalue=78', {
    ...params,
  });
}

/**
 * 日志信息_详情
 */
export async function getLogDetailApi(data: { id: number }) {
  return requestClient.post<any>(
    '/api/query/view?pagevalue=79',
    {
      ...parseQueryValues(data),
    },
    { formatData: true },
  );
}
