import request from '@/utils/request'

/** 商品详情聚合（匿名） */
export function getGoodsDetail(goodsId) {
  return request({
    url: `/api/goods/${goodsId}`,
    method: 'GET',
    header: { isToken: false },
    silent: true
  })
}

/** 可购四条件校验（加购/购买前可重调） */
export function getGoodsCanPurchase(goodsId) {
  return request({
    url: `/api/goods/${goodsId}/can-purchase`,
    method: 'GET',
    header: { isToken: false },
    silent: true
  })
}

/** 商品评价分页 */
export function getGoodsReviews(goodsId, params) {
  return request({
    url: `/api/goods/${goodsId}/reviews`,
    method: 'GET',
    params,
    header: { isToken: false },
    silent: true
  })
}
