import request from '@/utils/request';

export function getList(data) {
  let param = '?page=' + data.page + '&size=' + data.size;
  if (data.title != undefined && data.title != '') {
    param += '&title=' + data.title;
  }
  if (data.date != undefined && data.date != '') {
    param += '&date=' + data.date;
  }
  return request({
    url: '/knowledge/list' + param,
    method: 'get',
    data,
  });
}

export function doDelete(data) {
  return request({
    url: '/knowledge/remove',
    method: 'post',
    data,
  });
}

export function doEdit(data) {
  return request({
    url: '/knowledge/update',
    method: 'post',
    data,
  });
}

export function doAdd(data) {
  return request({
    url: '/knowledge/insert',
    method: 'post',
    data,
  });
}
export function getCategoryDict(data) {
  return request({
    url: '/knowledge/categoryDict',
    method: 'get',
    data,
  });
}
