2025-04-30 00:17:09 +08:00
|
|
|
import http from '@core/http';
|
|
|
|
|
|
|
|
import type { SceneDetail, SceneInfo } from './type';
|
|
|
|
|
2025-04-29 20:08:08 +08:00
|
|
|
const enum API {
|
|
|
|
获取场景 = '/scene/getById',
|
|
|
|
}
|
|
|
|
|
2025-04-30 00:17:09 +08:00
|
|
|
export async function getSceneById(id: SceneInfo['id']): Promise<SceneDetail | null> {
|
|
|
|
if (!id) return null;
|
|
|
|
type B = { id: string };
|
|
|
|
type D = SceneDetail;
|
|
|
|
const body = { id };
|
|
|
|
const data = await http.post<D, B>(API.获取场景, body);
|
|
|
|
return data ?? null;
|
|
|
|
}
|