import http from '@/http'

export const downFileById = params =>
  http.get('/file/download', { params, responseType: 'blob' }) // 根据文件id下载(单个)

export const districtList = params => http.get('/api/v1/region/tree', { params }) // 区划树
export const getOrgLine = params => http.get('/api/v1/gov-business-strip/get-child-list', { params }) // 获取条线标签的的树状结构
export const userMenu = params =>
  http.get('/api/v1/menu/myMenu', { params })// 查询当前登录用户的菜单
export const dictAll = data => http.post('/api/v1/meta/dictionary/list', data) // 字典
export const getDictionaryTree = data => http.post('/api/v1/meta/tag', data) // 获取专家标签的树状结构

export const findUrlById = data => http.post('/file/findUrlEntryById', data) // 根据文件id，获取文件临时的访问路径

export const downloadToPdfStream = params =>
  http.get('/api/v1/wps-convert/downloadToPdfStream', { params, responseType: 'blob' }) // 根据文件ID预览PDF文件
export const getOrganizationByCode = code => http.get(`/api/v1/irs/org/getOrganizationByCode/${code}`) // 获取企业信息
export const getBusinessstripLine = code => http.get(`/api/v1/belong-org/business-strip/list`) // 专家条线

