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}ulist`, { data });
};


export const httpBusinesslist = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}businesslist`, { data });
};

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

export const httpDelete = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}itemdel`, { data });
};

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

export const httpGoldlist = (data:object = {}): ResponseType => {
  return http.request("post", `${yewuApi}refresh`, { data });
};
