import request from "@/utils/request.js";

/**
 * 查询分类信息
 * @param {*} params
 * @returns
 */
export function categoryList(params) {
  return request({
    method: "get",
    url: "/product/admin/prod/category/list",
    params,
  });
}

/**
 * 查询商品列表
 * @param {*} params
 * @returns
 */
export function productPage(params) {
  return request({
    method: "get",
    url: "/product/admin/product/list",
    params,
  });
}

/**
 * 商品上下架
 * @param {*} data
 * @returns
 */
export function productOnOff(data) {
  return request({
    method: "post",
    url: "/product/admin/product/onOff",
    data,
  });
}

/**
 * 商品售罄
 * @param {*} data
 * @returns
 */
export function markIsSoldOut(data) {
  return request({
    method: "post",
    url: "/product/admin/product/markIsSoldOut",
    data,
  });
}
