service.ts 727 Bytes
Newer Older
1
import request from 'umi-request';
陈帅's avatar
陈帅 committed
2
import { TableListParams } from './data';
3

陈帅's avatar
陈帅 committed
4
export async function queryRule(params: TableListParams) {
陈帅's avatar
陈帅 committed
5
  return request(`/api/rule`, {
6 7 8 9
    params,
  });
}

陈帅's avatar
陈帅 committed
10
export async function removeRule(params: TableListParams) {
陈帅's avatar
陈帅 committed
11
  return request('/api/rule', {
12 13 14 15 16 17 18 19
    method: 'POST',
    data: {
      ...params,
      method: 'delete',
    },
  });
}

陈帅's avatar
陈帅 committed
20
export async function addRule(params: TableListParams) {
陈帅's avatar
陈帅 committed
21
  return request('/api/rule', {
22 23 24 25 26 27 28 29
    method: 'POST',
    data: {
      ...params,
      method: 'post',
    },
  });
}

陈帅's avatar
陈帅 committed
30
export async function updateRule(params: TableListParams) {
陈帅's avatar
陈帅 committed
31
  return request('/api/rule', {
32 33 34 35 36 37 38
    method: 'POST',
    data: {
      ...params,
      method: 'update',
    },
  });
}