import { http } from "@/utils/http";
import { interfaceUrlApi } from "../utils";

export interface BasicResponseModel<T = any> {
  code: number;
  msg: string;
  list: T;
  data: T;
  total: number;
}

/**
 * 获取调用记录列表
 * @param query
 */
export const getIpInterfaceCallList = (query?: object) => {
  return http.get<BasicResponseModel, any>(
    interfaceUrlApi("ipInterface/call/list"),
    {
      params: query
    }
  );
};

/**
 * 根据ID获取调用记录详细信息
 * @param id
 */
export const getIpInterfaceCallDetailById = (id: string) => {
  return http.request<BasicResponseModel>(
    "get",
    interfaceUrlApi(`ipInterface/call/detail/${id}`)
  );
};

/**
 * 查询接口回调记录
 * @param id
 */
export const getIpInterfaceCallRecord = (id: string) => {
  return http.request<BasicResponseModel>(
    "get",
    interfaceUrlApi(`ipInterface/call/callback/history/${id}`)
  );
};
