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

export namespace logApi {
  export interface LoginLog {
    // id: number;
    // org_id: string;
    // type: string;
    // key: string;
    // value: string;
    // created_at: string;
    // updated_at: string;
    [key: string]: any;
  }
  export interface alarmLog {
    [key: string]: any;
  }
  export interface actionLog {
    [key: string]: any;
  }
}
export const getActionLogList = (param: {
  end_time?: string;
  oper_name?: string;
  org_id: string;
  page_num?: number;
  page_size?: number;
  start_time?: string;
}) => {
  return requestClient.get<logApi.actionLog[]>(
    '/identify-service/logs/oper-log',
    {
      params: {
        ...param,
      },
    },
  );
};

export const getLoginLogList = (param: {
  end_time: string;
  org_id: string;
  page_num: number;
  page_size: number;
  start_time: string;
  user_name: string;
}) => {
  return requestClient.get<logApi.LoginLog[]>(
    '/identify-service/logs/login-log',
    {
      params: {
        ...param,
      },
    },
  );
};
export const getAlarmLogList = (param: {
  end_time: string;
  org_id: string;
  page: number;
  page_size: number;
  start_time: string;
  type?: 0 | 1 | 2 | 3;
  user_name: string;
}) => {
  return requestClient.get<logApi.alarmLog[]>(
    '/device-management/devices/logs',
    {
      params: {
        ...param,
      },
    },
  );
};
