import request from '@/utils/request'

// 创建须知
export function createNeedKnow(data) {
  return request({
    url: '/system/need-know/create',
    method: 'post',
    data: data
  })
}

// 更新须知
export function updateNeedKnow(data) {
  return request({
    url: '/system/need-know/update',
    method: 'put',
    data: data
  })
}

// 删除须知
export function deleteNeedKnow(id) {
  return request({
    url: '/system/need-know/delete?id=' + id,
    method: 'delete'
  })
}

// 获得须知
export function getNeedKnow(id) {
  return request({
    url: '/system/need-know/get?id=' + id,
    method: 'get'
  })
}

// 根据key获得须知
export function getNeedKnowByKey(key) {
  return request({
    url: '/system/need-know/getByKey?key=' + key,
    method: 'get'
  })
}

// 获得须知分页
export function getNeedKnowPage(query) {
  return request({
    url: '/system/need-know/page',
    method: 'get',
    params: query
  })
}

// 导出须知 Excel
export function exportNeedKnowExcel(query) {
  return request({
    url: '/system/need-know/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
