import { http } from "/@/utils/http";
import { loadEnv } from "@build/index";
const { VITE_PROXY_DOMAIN_REAL, VITE_PROXY_USER_REAL } = loadEnv();
const userAPi = VITE_PROXY_DOMAIN_REAL;
const yewuApi = VITE_PROXY_USER_REAL + "/admin/";
interface ResponseType extends Promise<any> {
  data?: object;
  code?: number;
  message?: string;
}

// 列表
export const httpList = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}redlist`, {
    data
  });
};

//批量红冲
export const httpBatchapplyred = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}batchapplyred`, {
    data
  });
};

//红冲
export const httpApplyred = (data: object): ResponseType => {
  return http.request("post", `${yewuApi}applyred`, {
    data
  });
};

//红冲后开票
export const httpOpenInvoice = (data: Record<string, string>): ResponseType => {
  return http.request("post", `${yewuApi}redopen`, {
    data
  });
};
