Initial commit
This commit is contained in:
32
modeler/src/views/decision/algorithm/api.ts
Normal file
32
modeler/src/views/decision/algorithm/api.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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 { Algorithm, AlgorithmPageableResponse, AlgorithmRequest } from './types';
|
||||
import type { BasicResponse } from '@/types';
|
||||
|
||||
const req = HttpRequestClient.create<BasicResponse>({
|
||||
baseURL: '/api',
|
||||
});
|
||||
|
||||
export const findAlgorithmsByQuery = (query: Partial<AlgorithmRequest> = {}): Promise<AlgorithmPageableResponse> => {
|
||||
return req.get('/algo/algorithm/list', query);
|
||||
};
|
||||
|
||||
export const createAlgorithm = (algorithm: Algorithm): Promise<BasicResponse> => {
|
||||
return req.postJson('/algo/algorithm', algorithm);
|
||||
};
|
||||
|
||||
export const updateAlgorithm = (algorithm: Algorithm): Promise<BasicResponse> => {
|
||||
return req.putJson('/algo/algorithm', algorithm);
|
||||
};
|
||||
|
||||
export const deleteAlgorithm = (id: number): Promise<BasicResponse> => {
|
||||
return req.delete(`/algo/algorithm/${id}`);
|
||||
};
|
||||
Reference in New Issue
Block a user