import request from '@/utils/request'

// 获取访问接口
export function visit(data) {
  return request({
    url: '/tracking/',
    method: 'post',
    data,
  })
}

// 获取新闻列表
export function getNews(params) {
  return request({
    url: '/news',
    method: 'get',
    params,
  })
}

// 获取新闻列表
export function getNewsDetail(params) {
  return request({
    url: '/news/details',
    method: 'get',
    params,
  })
}

// 保存新闻
export function updateNews(data) {
  return request({
    url: '/news/B8fpNxunbxj37x3VRcVz',
    method: 'post',
    data,
  })
}

// 获取新闻列表
export function saveDetail(data) {
  return request({
    url: '/news/VbxWW8EdJQGyWzJyvSrN',
    method: 'post',
    data,
  })
}

// 获取下载资源
export function downloadList(params) {
  return request({
    url: `${window.config.downloadUrl}api/minio/Object/list`,
    method: 'get',
    params,
  })
}

export function downloadFile(params) {
  return request({
    url: `${window.config.downloadUrl}api/minio/Object/url`,
    method: 'get',
    params,
  })
}
