
import baseAxios from '../index'

const prefix = '/article'


export function getNewsList (data: {
  limit: number,
  offset: number
}) {
  return baseAxios({
    method: 'post',
    url: prefix + '/query/news/list',
    data,
  })
}

export function searchNews(title: string) {
  return baseAxios({
    method: 'get',
    url: prefix + '/query/fuzzy/news',
    params: {
      title
    }
  })
}

export function getDetails(uuid: string) {
  return baseAxios({
    method: 'get',
    url: prefix + '/query/news',
    params: {
      uuid
    }
  })
}

export function getPolicyList (data: {
  limit: number,
  offset: number
}) {
  return baseAxios({
    method: 'post',
    url: prefix + '/query/policy/list',
    data,
  })
}

export function searchPolicy(title: string) {
  return baseAxios({
    method: 'get',
    url: prefix + '/query/fuzzy/policy',
    params: {
      title
    }
  })
}

export function getPolicyDetails(uuid: string) {
  return baseAxios({
    method: 'get',
    url: prefix + '/query/policy',
    params: {
      uuid
    }
  })
}
