import request from '@/utils/request'

// 查询信息分类列表
export function listCmsCategory(query) {
  return request({
    url: '/business/cmsCategory/list',
    method: 'get',
    params: query
  })
}
// 查询一级分类列表
export function listParentCmsCategory() {
  return request({
    url: '/business/cmsCategory/parentList',
    method: 'get'
  })
}

// 查询类型下拉树结构
export function treeselect() {
  return request({
    url: '/business/cmsCategory/treeselect',
    method: 'get'
  })
}
// 查询信息分类详细
export function getCmsCategory(categoryId) {
  return request({
    url: '/business/cmsCategory/' + categoryId,
    method: 'get'
  })
}

// 新增信息分类
export function addCmsCategory(data) {
  return request({
    url: '/business/cmsCategory',
    method: 'post',
    data: data
  })
}

// 修改信息分类
export function updateCmsCategory(data) {
  return request({
    url: '/business/cmsCategory',
    method: 'put',
    data: data
  })
}

// 删除信息分类
export function delCmsCategory(categoryId) {
  return request({
    url: '/business/cmsCategory/' + categoryId,
    method: 'delete'
  })
}

// 导出信息分类
export function exportCmsCategory(query) {
  return request({
    url: '/business/cmsCategory/export',
    method: 'get',
    params: query
  })
}
