import request from "@/utils/request";
const baseURL = "/product/admin/prod/group";
// 商品管理-商品分类
const AuthAPI = {
  // 列表
  getList(params: any) {
    return request<any, Responseres>({
      url: `${baseURL}/list`,
      method: "get",
      params,
    });
  },
  /** 分页*/
  getPage(params: any) {
    return request<any, Responseres>({
      url: `${baseURL}/page`,
      method: "get",
      params,
    });
  },
  // 新增
  addunit(data: any) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "post",
      data: { ...data },
    });
  },
  // 获取详情
  getunitinfo(id: number) {
    return request<any, Responseres>({
      url: `${baseURL}/${id}`,
      method: "get",
    });
  },
  // 编辑确定
  update(data: Object) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "put",
      data,
    });
  },
  // 简单修改
  // /admin/prod/group/update
  updates(data: Object) {
    return request<any, Responseres>({
      url: `${baseURL}/update`,
      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;