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


const newYewuApi = "http://project.test241.wanyuhengtong.com" + "/user/"

interface ResponseType extends Promise<any> {
  data?: object;
  code?: number;
  message?: string;
}

export const httpList = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}customerlist`, { data });
};
export const httpCreate = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}customercreate`, { data });
};
export const httpUpdate = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}customerupdate`, { data });
};
export const httpInfo = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}customerselect`, { data });
};
export const httpDelete = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}customardelete`, { data });
};
export const httpStatus = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}customerstatus`, { data });
};


export const httpEnterpriseInfo = (data:object = {}): ResponseType => {
  return http.request("post", `${newYewuApi}customer/info`, { data });
};
export const httpEnterpriseCreate = (data:object = {}): ResponseType => {
  return http.request("post", `${newYewuApi}customer/create`, { data });
};
export const httpEnterpriseUpdate = (data:object = {}): ResponseType => {
  return http.request("post", `${newYewuApi}customer/save`, { data });
};
export const httpEnterpriseStatus = (data:object = {}): ResponseType => {
  return http.request("post", `${newYewuApi}customer/status`, { data });
};

