import { defHttp } from '/@/utils/http/axios';
import { LogQueryParam } from './model/logModel';

enum LogManagerApi {
  LOG_DETAIL_URL = '/log',
  LOG_EXCEPTION_URL = '/log/exception',
  LOG_OPERATE_URL = '/log/operate',
  LOG_USER_URL = '/log/user',
  LOG_BACKUP_URL ='/log/backup'
}
export const getBackupPage = (params: LogQueryParam) => {
  return defHttp.get<LogQueryParam>({
    url: LogManagerApi.LOG_BACKUP_URL,
    params,
  });
};
export const getExceptionPage = (params: LogQueryParam) => {
  return defHttp.get<LogQueryParam>({
    url: LogManagerApi.LOG_EXCEPTION_URL,
    params,
  });
};

export const getOperatePage = (params: LogQueryParam) => {
  return defHttp.get<LogQueryParam>({
    url: LogManagerApi.LOG_OPERATE_URL,
    params,
  });
};

export const getUserPage = (params: LogQueryParam) => {
  return defHttp.get<LogQueryParam>({
    url: LogManagerApi.LOG_USER_URL,
    params,
  });
};

// 异常详情
export const getLogManageDetail = (id: string) => {
  return defHttp.get({
    url: LogManagerApi.LOG_DETAIL_URL + `/${id}`,
  });
};

