import request from 'umi-request';
import { TableListItem } from './data';

export async function queryRule(params?: Object) {
  return request('/api/category/category-list', {
    method: 'POST',
    data: params,
  });
}

export async function queryAllCategory() {
  return request('/api/category/all-category', {
    method: 'POST'
  });
}

export async function addRule(params: Object) {
  return request('/api/category/save-category', {
    method: 'POST',
    data: params,
  });
}

export async function removeRule(params: TableListItem) {
  return request('/api/category/del-category', {
    method: 'POST',
    data: params,
  });
}