24 lines
680 B
TypeScript
24 lines
680 B
TypeScript
import { NextResponse } from "next/server";
|
|
import { getThreeDModelAliasConfigForRuntime } from "@/lib/model3d/model-alias-config-server";
|
|
import { toPublicThreeDModelAliasConfig } from "@/lib/model3d/model-alias-config";
|
|
|
|
export async function GET() {
|
|
try {
|
|
const config = await getThreeDModelAliasConfigForRuntime();
|
|
|
|
return NextResponse.json({
|
|
success: true,
|
|
data: toPublicThreeDModelAliasConfig(config),
|
|
});
|
|
} catch (error) {
|
|
console.error("[ThreeDModelAliases] GET failed:", error);
|
|
return NextResponse.json(
|
|
{
|
|
success: false,
|
|
error: "获取 3D 模型显示映射失败",
|
|
},
|
|
{ status: 500 },
|
|
);
|
|
}
|
|
}
|