import request from '@/utils/request'

// 新增商家商品
export function shopProductAdd (data) {
  return request({
    url: '/shop/product/add',
    method: 'post',
    data
  })
}
// 删除商家商品
export function shopProductDel (id) {
  return request({
    url: `/shop/product/del/${id}`,
    method: 'post',
  })
}
// 修改商家商品
export function shopProductEdit (data) {
  return request({
    url: `/shop/product/edit`,
    method: 'post',
    data
  })
}
// 获取商家商品详细信息
export function shopProductInfo (id) {
  return request({
    url: `/shop/product/info/${id}`,
    method: 'get',
  })
}
// 查询商家商品列表
export function shopProductPage (query) {
  return request({
    url: `/shop/product/page`,
    method: 'get',
    params: query
  })
}
// 设置商家商品上下架
export function shopProductStatus (id) {
  return request({
    url: `/shop/product/shelvedStatus/${id}`,
    method: 'post',
  })
}
// 平台为了审核分页查询产品列表
export function productAuditList (query) {
  return request({
    url: `/shop/product/audit_list`,
    method: 'get',
    params: query
  })
}
// 产品审核
export function productAudit (data) {
  return request({
    url: `/shop/product/audit`,
    method: 'post',
    data
  })
}
// 产品推荐
export function productRecommendStatus (productIds) {
  return request({
    url: `/shop/product/recommendStatus/${productIds}`,
    method: 'post'
  })
}

// 查询商家直营商品，并显示是否参加了活动 (秒杀、拼团)
export function productForActivityPage(query) {
    return request({
        url: '/shop/product/forActivity',
        method: 'get',
        params: query
    })
}