import request from "@/utils/request";
const baseURL = "/product/admin/prod/spec";
// 商品管理-商品规格

const AuthAPI = {
  // 新快捷新增
  quickAdd(data: any) {
    return request<any, Responseres>({
      url: `${baseURL}/quickAdd`,
      method: "post",
      data,
    });
  },
  /** 列表*/
  getPage(params: any) {
    return request<any, Responseres>({
      url: `${baseURL}/list`,
      method: "get",
      params,
    });
  },
  // 新增
  addunit(data: any) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "post",
      data: { ...data, sort: '1' },
    });
  },
  // 获取详情
  getunitinfo(id: number) {
    return request<any, Responseres>({
      url: `${baseURL}/${id}`,
      method: "get",
    });
  },
  // 编辑确定
  update(data: Object) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "put",
      data,
    });
  },
  // 删除
  deleteByIds(id: number | String) {
    return request<any, Responseres>({
      url: `${baseURL}/${id}`,
      method: "delete",
    });
  },

};




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

export default AuthAPI;