import request from "@/utils/request";

// 获取商品列表
export function getGoodsList(params) {
  return request({
    url: "/goods/list/page",
    method: "get",
    params,
  });
}

// 删除商品
export function deleteGoods(params) {
  return request({
    url: "/goods/delete",
    method: "post",
    params,
  });
}

// 获取商品分类
export function getClassifyList(params) {
  return request({
    url: "/goods/category/list",
    method: "get",
    params,
  });
}

// 添加分类
export function addClassify(params) {
  return request({
    url: "/goods/category/add",
    method: "post",
    data: params,
  });
}

// 编辑分类
export function editClassify(params) {
  return request({
    url: "/goods/category/update",
    method: "post",
    data: params,
  });
}

// 删除分类
export function deleteClassify(params) {
  return request({
    url: "/goods/category/delete",
    method: "post",
    params,
  });
}

// 获取分类详情
export function getClassifyDetail(params) {
  return request({
    url: "/goods/category/detail",
    method: "get",
    params,
  });
}

// 获取运费模版列表
export function getFreightList(params) {
  return request({
    url: "/freight/list",
    method: "get",
    params,
  });
}

// 添加商品
export function addGoods(params) {
  return request({
    url: "/goods/add",
    method: "post",
    data: params,
  });
}

// 编辑商品
export function editGoods(params) {
  return request({
    url: "/goods/update",
    method: "post",
    data: params,
  });
}

// 克隆商品
export function cloneGoods(params) {
  return request({
    url: "/goods/clone",
    method: "post",
    params,
  });
}

// 获取运费模版列表
export function getGoodsDetail(params) {
  return request({
    url: "/goods/detail",
    method: "get",
    params,
  });
}

// 获取商品状态条数
export function getGoodsStateCount(params) {
  return request({
    url: "/goods/count",
    method: "get",
    params,
  });
}

// 商品批量上架
export function goodsPutOn(params) {
  return request({
    url: "/goods/goods/on",
    method: "post",
    data: params,
  });
}

// 商品批量下架
export function goodsPutOff(params) {
  return request({
    url: "/goods/goods/off",
    method: "post",
    data: params,
  });
}

// 商品批量下架
export function checkSeckill(params) {
  return request({
    url: "/goods/goods/off/check/batch",
    method: "post",
    data: params,
  });
}

// 获取模块列表
export function getModuleList(params) {
  return request({
    url: "/template/list",
    method: "get",
    params,
  });
}

// 删除模块
export function deleteModule(params) {
  return request({
    url: "/template/delete",
    method: "post",
    params,
  });
}

// 添加模块
export function addModule(params) {
  return request({
    url: "/template/save",
    method: "post",
    data: params,
  });
}

// 编辑模块
export function editModule(params) {
  return request({
    url: "/template/update",
    method: "post",
    data: params,
  });
}

// 获取模块详情
export function getModuleDetail(params) {
  return request({
    url: "/template/detail",
    method: "get",
    params,
  });
}

// 编辑公共模块
export function editCommonModule(params) {
  return request({
    url: "/template/pub/update",
    method: "post",
    data: params,
  });
}

// 获取公共模块详情
export function getCommonModuleDetail(params) {
  return request({
    url: "/template/pub/query",
    method: "get",
    params,
  });
}

// 商品批量设置模块
export function setCommomModule(params) {
  return request({
    url: "/goods/goods/template",
    method: "post",
    data: params,
  });
}

// 商品批量设置运费
export function setFreight(params) {
  return request({
    url: "/goods/goods/batch/freight",
    method: "post",
    data: params,
  });
}

// 获取商品列表
export function getMoreGoodsList(params) {
  return request({
    url: "/goods/listbycategory",
    method: "get",
    params,
  });
}

// 获取商品列表
export function getMarketingList(params) {
  return request({
    url: "/goods/marketing/list",
    method: "get",
    params,
  });
}

// 获取小类列表
export function getSmallType(params) {
  return request({
    url: "/common/gongdan/smalltype",
    method: "get",
    params,
  });
}

// 获取标签列表
export function getTagList(params) {
  return request({
    url: "/goods/tag/page",
    method: "get",
    params,
  });
}

// 分页获取商品新维度分类
export function getNewclassify(params) {
  return request({
    url: "/goods/news/category/page",
    method: "get",
    params,
  });
}

// 添加新维度分类
export function addNewclassify(params) {
  return request({
    url: "/goods/news/category/addGoodsNewsCategory",
    method: "post",
    params,
  });
}

// 新维度分类详情
export function getNewclassifyDetail(params) {
  return request({
    url: "/goods/news/category/detail",
    method: "get",
    params,
  });
}

// 编辑新维度分类
export function editNewclassifyDetail(params) {
  return request({
    url: "/goods/news/category/vimGoodsNewsCategory",
    method: "post",
    data: params,
  });
}

// 开启关闭新维度分类
export function changeNewclassify(params) {
  return request({
    url: "/goods/news/category/editStatus",
    method: "post",
    params,
  });
}

// 删除新维度分类
export function deleteNewclassify(params) {
  return request({
    url: "/goods/news/category/delete",
    method: "post",
    params,
  });
}

// 商品批量修改分类
export function setCategory(params) {
  return request({
    url: "/goods/batch/category/update",
    method: "post",
    data: params,
  });
}
