import { loadEnv } from "@build/index";
import { http } from "/@/utils/http";

const { VITE_PROXY_DOMAIN_REAL } = loadEnv();

// 添加
export async function httpAdd(data: object = {}): Promise<DataType<any>> {
  return http.request(
    "post",
    `${VITE_PROXY_DOMAIN_REAL}admin/inventoryShoppingAdd`,
    {
      data
    }
  );
}
//改
export async function httpUpdate(data: object): Promise<DataType<any[]>> {
  return http.request(
    `post`,
    `${VITE_PROXY_DOMAIN_REAL}admin/inventoryShoppingEdit`,
    {
      data
    }
  );
}

//查详情
export async function httpDetail(data: object): Promise<DataType<any[]>> {
  return http.request(
    `post`,
    `${VITE_PROXY_DOMAIN_REAL}admin/inventoryShoppingRead`,
    {
      data
    }
  );
}
//查列表
export async function httpList(data: object): Promise<DataType<any[]>> {
  return http.request(
    `post`,
    `${VITE_PROXY_DOMAIN_REAL}admin/inventoryShoppingList`,
    {
      data
    }
  );
}
//修改记录
export async function httpLog(data: object): Promise<DataType<any[]>> {
  return http.request(
    `post`,
    `${VITE_PROXY_DOMAIN_REAL}admin/inventoryShoppingLog`,
    {
      data
    }
  );
}
