Files
auto-solution/modeler/src/views/decision/rule/api.ts

39 lines
1.2 KiB
TypeScript
Raw Normal View History

2026-03-14 20:55:15 +08:00
/*
* This file is part of the kernelstudio package.
*
* (c) 2014-2026 zlin <admin@kernelstudio.com>
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/
import { HttpRequestClient } from '@/utils/request';
import type { FireRule, FireRulePageableResponse, FireRuleRequest } from './types';
2026-03-16 22:43:12 +08:00
import type { PlatformWithComponentsResponse } from '../types';
2026-03-14 20:55:15 +08:00
import type { BasicResponse } from '@/types';
const req = HttpRequestClient.create<BasicResponse>({
baseURL: '/api',
});
export const findFireRuleByQuery = (query: Partial<FireRuleRequest> = {}): Promise<FireRulePageableResponse> => {
return req.get('/system/rule/list', query);
};
export const createFireRule = (fireRule: FireRule): Promise<BasicResponse> => {
return req.postJson('/system/rule', fireRule);
};
export const updateFireRule = (fireRule: FireRule): Promise<BasicResponse> => {
return req.putJson('/system/rule', fireRule);
};
export const deleteFireRule = (id: number): Promise<BasicResponse> => {
return req.delete(`/system/rule/${id}`);
};
2026-03-16 22:43:12 +08:00
export const findAllPlatformWithComponents = (): Promise<PlatformWithComponentsResponse> => {
return req.get(`/system/firerule/platforms`);
};
2026-03-14 20:55:15 +08:00