import request from "@/utils/axiosReq";
import { ObjTy } from "~/common";

export function Query(params) {
  return request({
    url: "/openApi/query",
    method: "post",
    data: params,
  });
}

export async function myQuery(id, ...dataContent) {
  const params = {
    id,
    dataContent,
  };
  try {
    const result = await Query(params);
    if (Number(result.code) === 0) {
      return result.returnData.listValues;
    } else {
      return Promise.reject(result.message);
    }
  } catch (error) {
    return Promise.reject(error);
  }
}

export function GeneralDataReception(params) {
  return request({
    url: "/openApi/generalDataReception",
    method: "post",
    data: params,
  });
}
