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

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

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

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

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

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