import request from '@/utils/request'

// 查询商品评论列表
export function listGoodsComment(data) {
  return request({
    url: '/mapi/goods/goodsComment/list',
    method: 'post',
    data: data
  })
}

// 查询商品评论详细
export function getGoodsComment(id) {
  return request({
    url: '/mapi/goods/goodsComment/' + id,
    method: 'get'
  })
}

// 新增商品评论
export function addGoodsComment(data) {
  return request({
    url: '/mapi/goods/goodsComment',
    method: 'post',
    data: data
  })
}

// 修改商品评论
export function updateGoodsComment(data) {
  return request({
    url: '/mapi/goods/goodsComment/updateComment',
    method: 'POST',
    data: data
  })
}

// 删除商品评论
export function delGoodsComment(id) {
  return request({
    url: '/mapi/goods/goodsComment/' + id,
    method: 'delete'
  })
}


// 修改商品评论状态
export function updateGoodsCommentStatus(id,status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/mapi/goods/goodsComment/updateStatus',
    method: 'post',
    data: data
  })
}
// 隐藏商品评论
export function noShowComment(ids) {
  return request({
    url: '/mapi/goods/goodsComment/noShowComment',
    method: 'post',
    data: ids
  })
}

// 显示商品评论
export function showComment(ids) {
  return request({
    url: '/mapi/goods/goodsComment/showComment',
    method: 'post',
    data: ids
  })
}

// 评论-商品查询
export function getCommentgood(data) {
  return request({
      url: '/mapi/core/goods/selectGoodsByGoodsType2Comment',
      method: 'post',
      data: data
  })
}

// 评论-商品物料查询
export function getCommentSku(data) {
  return request({
      url: '/mapi/core/goods/selectGoodsSkuByGoodsId2Comment',
      method: 'post',
      data: data
  })
}

// 新增商品评论回复
export function getCommentReply(data) {
  return request({
      url: '/mapi/goods/reply/addCommentReply',
      method: 'post',
      data: data
  })
}

// 查询商品评论回复
export function getQueryCommentReply(data) {
  return request({
      url: '/mapi/goods/reply/queryCommentReplyByCommentId',
      method: 'post',
      data: data
  })
}
