import request from '@/utils/request'

export function listNews(query) {
  return request({
    url: '/homepage/news/list',
    method: 'get',
    params: query
  })
}

export function getNews(newsId) {
  return request({
    url: '/homepage/news/' + newsId,
    method: 'get'
  })
}

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

export function updateNews(data) {
  return request({
    url: '/homepage/news',
    method: 'put',
    data: data
  })
}

export function delNews(newsId) {
  return request({
    url: '/homepage/news/' + newsId,
    method: 'delete'
  })
}
