/**
 * @description 系统日志API
 * @author yslg
 * @since 2025-10-30
 */

import { api } from '../index';
import type { LoginLog, OperationLog } from '@/types/log';
import type { PageParam, ResultDomain } from '@/types';

/**
 * 日志API接口
 */
export const logApi = {
  baseUrl: '/sys/log',

  async getLoginLogPage(pageParam: PageParam, filter: LoginLog): Promise<ResultDomain<LoginLog>> {
    const response = await api.post<LoginLog>(`${this.baseUrl}/login/page`, {
      pageParam,
      filter,
    });
    return response.data;
  },

  async getOperationLogPage(pageParam: PageParam, filter: OperationLog): Promise<ResultDomain<OperationLog>> {
    const response = await api.post<OperationLog>(`${this.baseUrl}/operation/page`, {
      pageParam,
      filter,
    });
    return response.data;
  }
};

