33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
/*
|
|
* 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 { Scenario, ScenarioPageableResponse, ScenarioRequest } from './types';
|
|
import type { PlatformWithComponentsResponse } from '../types';
|
|
import type { BasicResponse } from '@/types';
|
|
|
|
const req = HttpRequestClient.create<BasicResponse>({
|
|
baseURL: '/api',
|
|
});
|
|
|
|
export const findScenarioByQuery = (_query: Partial<ScenarioRequest> = {}): Promise<ScenarioPageableResponse> => {
|
|
return req.get('/system/scene/list', _query);
|
|
};
|
|
|
|
export const deleteOneScenarioById = (id: number): Promise<BasicResponse> => {
|
|
return req.delete(`/system/behaviortree/${id}`);
|
|
};
|
|
|
|
export const findPlatformWithComponents = (id: number): Promise<PlatformWithComponentsResponse> => {
|
|
return req.get(`/system/firerule/platforms/${id}`);
|
|
};
|
|
|
|
export const saveScenario = (scenario: Scenario): Promise<BasicResponse> => {
|
|
return req.postJson(`/system/scene/saveSceneConfig`,scenario);
|
|
}; |