import request from "@/utils/request";

// 商品分类管理
// /platformProductClassify/getAll 商品类别管理查询
export const getAllClass = (data) =>
  request({
    url: "/platformProductClassify/getAll",
    method: "POST",
    data,
  });

// /platformProductClassify/save 添加商品类别
export const createdShopClass = (data) =>
  request({
    url: "/platformProductClassify/save",
    method: "POST",
    data,
  });

// /platformProductClassify/update 修改商品类别
export const updateClass = (data) =>
  request({
    url: "/platformProductClassify/update",
    method: "POST",
    data,
  });

// /platformProductClassify/delete 删除商品类别
export const deleteClass = (data) =>
  request({
    url: "/platformProductClassify/delete",
    method: "POST",
    data,
  });

// /platformProductClassify/getById 商品类别编辑/查询
export const getClassDetails = (data) =>
  request({
    url: "/platformProductClassify/getById",
    method: "POST",
    data,
  });

// 选品管理
// 选品管理查询
export function getClassifyGetAll(data) {
  return request({
    url: "/platformProduct/getAll",
    method: "POST",
    data,
  });
}
// /platformProduct/save  新增选品商品
export function getClassifyAdd(data) {
  return request({
    url: "/platformProduct/save",
    method: "POST",
    data,
  });
}

// /platformProduct/update 修改选品商品
export function getClassifyUpdate(data) {
  return request({
    url: "/platformProduct/update",
    method: "POST",
    data,
  });
}

// /platformProduct/delete 删除商品
export function getClassifyDelete(data) {
  return request({
    url: "/platformProduct/delete",
    method: "POST",
    data,
  });
}

// /platformProduct/start 商品上下架
export function getClassifyStart(data) {
  return request({
    url: "/platformProduct/start",
    method: "POST",
    data,
  });
}

// 获取品牌列表
export function getBrandList() {
  return request({
    url: "/platformProduct/getBrandList",
    method: "POST",
  });
}

// 商品分类
export function getClassify(data) {
  return request({
    url: "/platformProduct/getClassify",
    method: "POST",
    data,
  });
}
// /voucher/getAll 获取可选择的代金卷
export function getVoucher(data) {
  return request({
    url: "/voucher/getAll",
    method: "POST",
    data,
  });
}

//  // 修改商品
export function getClassifyGetById(data) {
  return request({
    url: "/platformProduct/getById",
    method: "post",
    data,
  });
}

// // 导出商品信息
// export function productExport(data) {
//   return request({
//     url: '/product/exportProduct',
//     method: 'post',
//     data,
//     responseType: 'blob'
//   })
// }

//  新增定价管理
export function addFixed(data) {
  return request({
    url: "/priceControl/save",
    method: "post",
    data,
  });
}

//  删除定价方案
export function delFixed(params) {
  return request({
    url: "/priceControl/delete",
    method: "delete",
    params,
  });
}

//  获取单个定价方案
export function getFixedOne(id) {
  return request({
    url: `/priceControl/${id}`,
    method: "get",
  });
}

//  更新定价方案
export function updateFixed(data) {
  return request({
    url: "/priceControl/update",
    method: "put",
    data,
  });
}

//  获取定价方案
export function getFixed(data) {
  return request({
    url: "/priceControl/page",
    method: "post",
    data,
  });
}


//  获取我的选品列表
export function getMyProduct(data) {
  return request({
    url: "canvas/getAll",
    method: "post",
    data,
  });
}

//  获取选品商家
export function getProductMerchant(data) {
  return request({
    url: "/selection/getShopAll",
    method: "post",
    data,
  });
}

//  获取选品商家当前下的选品列表
export function getProductMerchantList(data) {
  return request({
    url: "/selection/getProductAll",
    method: "post",
    data,
  });
}

//  加入选品库
export function addProduct(data) {
  return request({
    url: "/selection/addSelectionLibrary",
    method: "post",
    data,
  });
}

//  获取商品详情
export function getProductDetail(data) {
  return request({
    url: "/selection/getProductDetails",
    method: "post",
    data,
  });
}