import request from '@/utils/request'

// 查询文章信息列表
export function listNews(query) {
  return request({
    url: '/system/news/list',
    method: 'get',
    params: query
  })
}

// 查询文章信息详细
export function getNews(newsId) {
  return request({
    url: '/system/news/' + newsId,
    method: 'get'
  })
}

// 新增文章信息
export function addNews(data) {
  return request({
    url: '/system/news',
    method: 'post',
    data: data
  })
}

// 修改文章信息
export function updateNews(data) {
  return request({
    url: '/system/news',
    method: 'put',
    data: data
  })
}

// 删除文章信息
export function delNews(newsId) {
  return request({
    url: '/system/news/' + newsId,
    method: 'delete'
  })
}

// 审核通过文章信息
export function examineNews(newsId) {
  return request({
    url: '/system/news/examine/'+ newsId,
    method: 'get',
  })
}

// 驳回文章信息
export function rejectNews(data) {
  return request({
    url: '/system/news/reject',
    method: 'post',
    data: data
  })
}
