import request from "@/utils/request";
import { Product_BaseUrl } from "@/api/config";
const baseURL = Product_BaseUrl + "/admin/product/consGroup";

const Api = {
  /** 分页*/
  getList(params: any) {
    return request<any>({
      url: `${baseURL}/page`,
      method: "get",
      params,
    });
  },
  /** 全部*/
  getAllList(params: any) {
    return request<any>({
      url: `${baseURL}/list`,
      method: "get",
      params,
    });
  },
  get(id: string | number) {
    return request<any>({
      url: `${baseURL}/` + id,
      method: "get",
    });
  },
  add(data: any) {
    return request<any>({
      url: `${baseURL}`,
      method: "post",
      data
    });
  },
  edit(data: any) {
    return request<any>({
      url: `${baseURL}`,
      method: "put",
      data
    });
  },
  disable(id: number | string) {
    return request<any>({
      url: `${baseURL}/disable/` + id,
      method: "post",
    });
  },
  enable(id: number | string) {
    return request<any>({
      url: `${baseURL}/enable/` + id,
      method: "post",
    });
  },
};



export default Api;
