import request from "@/utils/request";
const baseURL = "/product/admin/storageGood";
// XXX-配置
const AuthAPI = {
  // 列表
  getList(params: any) {
    return request<any, Responseres>({
      url: `${baseURL}/list`,
      method: "get",
      params,
    });
  },
  /** 分页*/
  getPage(params: any) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "get",
      params,
    });
  },
  // 获取用户店铺列表
  getshopUser(params: any) {
    return request<any, Responseres>({
      url: `/account/admin/shopUser`,
      method: "get",
      params,
    });
  },
  // 新增
  add(data: any) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "post",
      data: { ...data },
    });
  },
  adds(data: any) {
    return request<any, Responseres>({
      url: `/product/admin/shopStorage`,
      method: "post",
      data: { ...data },
    });
  },
  // 详情
  getinfo(id: number) {
    return request<any, Responseres>({
      url: `${baseURL}/detail?id=${id}`,
      method: "get",
    });
  },
  // 编辑
  update(data: Object) {
    return request<any, Responseres>({
      url: `${baseURL}/edit`,
      method: "put",
      data,
    });
  },
  updates(data: Object) {
    return request<any, Responseres>({
      url: `/product/admin/shopStorage`,
      method: "put",
      data,
    });
  },
  // 删除
  deleteByIds(data: number | String) {
    return request<any, Responseres>({
      url: `${baseURL}?id=${data}`,
      method: "delete",
    });
  },

};
export interface Responseres {
  code?: number | null;
  data?: any;
  msg?: null | string;
  [property: string]: any;
}

export default AuthAPI;