import request from '@/utils/request'

// 新增供应商
export function supplierAdd (data) {
  return request({
    url: '/shop/supplier/add',
    method: 'post',
    data
  })
}
// 修改供应商
export function supplierEdit (data) {
  return request({
    url: '/shop/supplier/edit',
    method: 'post',
    data
  })
}
// 删除供应商
export function supplierDel (supplierIds) {
  return request({
    url: `/shop/supplier/del/${supplierIds}`,
    method: 'post',
  })
}
// 查询供应商列表
export function supplierPage (query) {
  return request({
    url: `/shop/supplier/page`,
    method: 'get',
    params: query
  })
}
// 获取供应商详细信息
export function supplierInfo (supplierId) {
  return request({
    url: `/shop/supplier/info/${supplierId}`,
    method: 'get',
  })
}
// 查询供应商列表（下拉框用）
export function supplierList () {
  return request({
    url: `/shop/supplier/list`,
    method: 'get',
  })
}
// 新增商品分类
export function productCategoryAdd (data) {
  return request({
    url: '/shop/productCategory/add',
    method: 'post',
    data
  })
}
// 商品分类上下架
export function productCategoryShelvedStatus (categoryId) {
  return request({
    url: `/shop/productCategory/shelvedStatus/${categoryId}`,
    method: 'post',
  })
}
// 修改商品分类
export function productCategoryEdit (data) {
  return request({
    url: '/shop/productCategory/edit',
    method: 'post',
    data
  })
}
// 分页查询商品分类列表
export function productCategoryPage (query) {
  return request({
    url: `/shop/productCategory/page`,
    method: 'get',
    params: query
  })
}
// 获取商品分类详细信息
export function productCategoryInfo (categoryId) {
  return request({
    url: `/shop/productCategory/info/${categoryId}`,
    method: 'get',
  })
}
// 删除商品分类
export function productCategoryDel (categoryId) {
  return request({
    url: `/shop/productCategory/del/${categoryId}`,
    method: 'post',
  })
}
// 查询商品分类列表
export function productCategoryList (query) {
  return request({
    url: `/shop/productCategory/list`,
    method: 'get',
    params: query
  })
}
// 新增产品
export function productAdd (data) {
  return request({
    url: '/shop/product/add',
    method: 'post',
    data
  })
}
// 修改产品
export function productEdit (data) {
  return request({
    url: '/shop/product/edit',
    method: 'post',
    data
  })
}
// 获取产品详细信息
export function productInfo (productId) {
  return request({
    url: `/shop/product/info/${productId}`,
    method: 'get',
  })
}
// 删除产品
export function productDel (productIds) {
  return request({
    url: `/shop/product/del/${productIds}`,
    method: 'post',
  })
}
// 查询产品列表
export function productPage (query) {
  return request({
    url: `/shop/product/page`,
    method: 'get',
    params: query
  })
}
// 产品上架
export function productShelvedStatus (productIds) {
  return request({
    url: `/shop/product/shelvedStatus/${productIds}`,
    method: 'post',
  })
}
// 分页查询订单列表
export function shopOrderPage (query) {
  return request({
    url: `/shoporder/shopOrder/page`,
    method: 'get',
    params: query
  })
}
// 简单发货(一次把订单中的商品发货)
export function simpleShip (data) {
  return request({
    url: `/shoporder/shopOrderPackage/simpleShip`,
    method: 'post',
    data
  })
}
// 获取订单详细信息
export function shopOrderInfo (orderId) {
  return request({
    url: `/shoporder/shopOrder/info/${orderId}`,
    method: 'get',
  })
}
// 获取订单发货包裹详细信息
export function shopOrderPackageInfo (packageId) {
  return request({
    url: `/shoporder/shopOrderPackage/info/${packageId}`,
    method: 'get',
  })
}
// 查询订单评论列表
export function shopOrderCommentPage (query) {
  return request({
    url: `/shoporder/shopOrderComment/page`,
    method: 'get',
    params: query
  })
}
// 删除订单评论
export function shopOrderCommentDel (commentIds) {
  return request({
    url: `/shoporder/shopOrderComment/del/${commentIds}`,
    method: 'post',
  })
}
// 简单发货修改(一次把订单中的商品发货)
export function simpleShipEdit (data) {
  return request({
    url: `/shoporder/shopOrderPackage/simpleShipEdit`,
    method: 'post',
    data
  })
}
// 产品置顶

export function productRecommendStatus (productIds) {
  return request({
    url: `/shop/product/recommendStatus/${productIds}`,
    method: 'post',
  })
}