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/";

export const httpList = (data: object): any => {
  return http.request("post", `${yewuApi}interlist`, {
    data
  });
};

export const httpUserList = (): any => {
  return http.request("post", `${yewuApi}userall`, { data: {} });
};

export const httpCreate = (data): any => {
  return http.request("post", `${yewuApi}interadd`, { data });
};

export const httpUpdate = (data): any => {
  return http.request("post", `${yewuApi}interedit`, { data });
};

export const httpDetail = (data): any => {
  return http.request("post", `${yewuApi}interinfo`, { data });
};

export const httpRatelist = (): any => {
  return http.request("post", `${yewuApi}getrate`, { data: {} });
};

export const httpCustomerlist = (data): any => {
  return http.request("post", `${yewuApi}customerlist`, { data });
};

export const httpCompanylist = (data): any => {
  return http.request("post", `${yewuApi}companylist`, {
    data: {
      ...data,
      noRela: true
    }
  });
};

export const httpSupplierlist = (data): any => {
  return http.request("post", `${yewuApi}supplier_by_super`, { data });
};

export const httpCategorylist = (data): any => {
  return http.request("post", `${yewuApi}intercat`, { data });
};

export const httpUserlist = (data): any => {
  return http.request("post", `${yewuApi}userlist`, { data });
};

export const httpPlatformlist = (data): any => {
  return http.request("post", `${yewuApi}interplatform`, { data });
};
