| 123456789101112131415161718192021 |
- import axios from 'axios';
- class AllocationService {
- BASE_URL = 'http://localhost:9090/model/allocation';
- async fetchAllocation(win, aggregate, options) {
- const { accumulate, filters, } = options;
- const params = {
- window: win,
- aggregate: aggregate,
- step: '1d',
- };
- if (typeof accumulate === 'boolean') {
- params.accumulate = accumulate;
- }
- const result = await axios.get(`${this.BASE_URL}/compute`, { params });
- return result.data;
- }
- }
- export default new AllocationService();
|