import request from '@/utils/request'

// 查询社区资讯列表
export function listNews(query) {
  return request({
    url: '/wuYe/news/list',
    method: 'get',
    params: query
  })
}

// 查询社区资讯详细
export function getNews(communityId) {
  return request({
    url: '/wuYe/news/' + communityId,
    method: 'get'
  })
}

// 新增社区资讯
export function addNews(data) {
  return request({
    url: '/wuYe/news',
    method: 'post',
    data: data
  })
}

// 修改社区资讯
export function updateNews(data) {
  return request({
    url: '/wuYe/news/put',
    method: 'post',
    data: data
  })
}

// 新增评论
export function commentIndexadd(data) {
  return request({
    url: '/wuYe/commentIndex',
    method: 'post',
    data: data
  })
}

// 点赞
export function giveTheThumbs(data) {
  return request({
    url: '/wuYe/commentLikes/giveTheThumbs',
    method: 'post',
    data: data
  })
}

// 收藏
export function getStars(data) {
  return request({
    url: '/wuYe/commentStars/getStars',
    method: 'post',
    data: data
  })
}

//回复列表
export function getRootComment(data) {
  return request({
    url: '/wuYe/commentIndex/getRootComment',
    method: 'post',
    data: data
  })
}


export function getParentComment(data) {
  return request({
    url: '/wuYe/commentIndex/getParentComment',
    method: 'post',
    data: data
  })
}




// 删除社区资讯
export function delNews(communityId) {
  return request({
    url: '/wuYe/news/delete/' + communityId,
    method: 'get'
  })
}

// 删除社区资讯评论
export function delNewsp(communityId) {
  return request({
    url: '/wuYe/commentIndex/delete/' + communityId,
    method: 'get'
  })
}


export function getCommentInteraction(data) {
  return request({
    url: '/wuYe/news/getCommentInteraction',
    method: 'post',
    data: data
  })
}

export function getCommentInteractionCount(data) {
  return request({
    url: '/wuYe/news/getCommentInteractionCount',
    method: 'post',
    data: data
  })
}



