import request from '@/utils/request'
const url = '/data-api'
export function fetchList(query) {
  return request({
    url: url + '/article/list',
    method: 'get',
    params: query
  })
}

export function fetchArticle(id) {
  return request({
    url: url + '/article/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchPv(pv) {
  return request({
    url: url + '/article/pv',
    method: 'get',
    params: { pv }
  })
}

export function createArticle(data) {
  return request({
    url: url + '/article/create',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: url + '/article/update',
    method: 'post',
    data
  })
}
