import request from '@/utils/request'

// 查询信息管理列表
export function listCmsNews(query) {
  return request({
    url: '/business/cmsNews/list',
    method: 'get',
    params: query
  })
}

export function frontList(query) {
  return request({
    url: '/business/cmsNews/front/list',
    method: 'get',
    params: query
  })
}

export function frontView(newsId) {
  return request({
    url: '/business/cmsNews/front/'+ newsId,
    method: 'get'
  })
}
export function frontViewByCategoryId(categoryId) {
  return request({
    url: '/business/cmsNews/front/category'+ categoryId,
    method: 'get'
  })
}

// 查询信息管理详细
export function getCmsNews(newsId) {
  return request({
    url: '/business/cmsNews/' + newsId,
    method: 'get'
  })
}
// 通过分类查询信息详细
export function getCmsNewsByCategoryId(categoryId) {
  return request({
    url: '/business/cmsNews/getInfoByCategoryId/' + categoryId,
    method: 'get'
  })
}


// 新增信息管理
export function addCmsNews(data) {
  return request({
    url: '/business/cmsNews',
    method: 'post',
    data: data
  })
}

// 修改信息管理
export function updateCmsNews(data) {
  return request({
    url: '/business/cmsNews',
    method: 'put',
    data: data
  })
}
// 修改置状态
export function updateTopStatus(data) {
  return request({
    url: '/business/cmsNews/updateTopStatus',
    method: 'put',
    data: data
  })
}
//修改轮播状态
export function updateCarouselStatus(data) {
  return request({
    url: '/business/cmsNews/updateCarouselStatus',
    method: 'put',
    data: data
  })
}
// 删除信息管理
export function delCmsNews(newsId) {
  return request({
    url: '/business/cmsNews/' + newsId,
    method: 'delete'
  })
}

// 导出信息管理
export function exportCmsNews(query) {
  return request({
    url: '/business/cmsNews/export',
    method: 'get',
    params: query
  })
}


