/* * This file is part of the kernelstudio package. * * (c) 2014-2026 zlin * * 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({ baseURL: '/api', }); export const findAlgorithmsByQuery = (query: Partial = {}): Promise => { return req.get('/algo/algorithm/list', query); }; export const createAlgorithm = (algorithm: Algorithm): Promise => { return req.postJson('/algo/algorithm', algorithm); }; export const runAlgorithm = (algorithm: Algorithm): Promise => { return req.postJson('/algo/algorithm/run', algorithm); }; export const updateAlgorithm = (algorithm: Algorithm): Promise => { return req.putJson('/algo/algorithm', algorithm); }; export const deleteAlgorithm = (id: number): Promise => { return req.delete(`/algo/algorithm/${id}`); };