N-Level 계층 구조 및 공간 종속성 시스템 구현
This commit is contained in:
@@ -19,6 +19,21 @@ interface ApiResponse<T> {
|
||||
error?: string;
|
||||
}
|
||||
|
||||
// 매핑 템플릿 타입
|
||||
export interface DigitalTwinMappingTemplate {
|
||||
id: string;
|
||||
company_code: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
external_db_connection_id: number;
|
||||
layout_type: string;
|
||||
config: any;
|
||||
created_by: string;
|
||||
created_at: string;
|
||||
updated_by: string;
|
||||
updated_at: string;
|
||||
}
|
||||
|
||||
// ========== 레이아웃 관리 API ==========
|
||||
|
||||
// 레이아웃 목록 조회
|
||||
@@ -281,3 +296,60 @@ export const getChildrenData = async (
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// ========== 매핑 템플릿 API ==========
|
||||
|
||||
// 템플릿 목록 조회 (회사 단위, 현재 사용자 기준)
|
||||
export const getMappingTemplates = async (params?: {
|
||||
externalDbConnectionId?: number;
|
||||
layoutType?: string;
|
||||
}): Promise<ApiResponse<DigitalTwinMappingTemplate[]>> => {
|
||||
try {
|
||||
const response = await apiClient.get("/digital-twin/mapping-templates", {
|
||||
params: {
|
||||
externalDbConnectionId: params?.externalDbConnectionId,
|
||||
layoutType: params?.layoutType,
|
||||
},
|
||||
});
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
return {
|
||||
success: false,
|
||||
error: error.response?.data?.message || error.message,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// 템플릿 생성
|
||||
export const createMappingTemplate = async (data: {
|
||||
name: string;
|
||||
description?: string;
|
||||
externalDbConnectionId: number;
|
||||
layoutType?: string;
|
||||
config: any;
|
||||
}): Promise<ApiResponse<DigitalTwinMappingTemplate>> => {
|
||||
try {
|
||||
const response = await apiClient.post("/digital-twin/mapping-templates", data);
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
return {
|
||||
success: false,
|
||||
error: error.response?.data?.message || error.message,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
// 템플릿 단건 조회
|
||||
export const getMappingTemplateById = async (
|
||||
id: string,
|
||||
): Promise<ApiResponse<DigitalTwinMappingTemplate>> => {
|
||||
try {
|
||||
const response = await apiClient.get(`/digital-twin/mapping-templates/${id}`);
|
||||
return response.data;
|
||||
} catch (error: any) {
|
||||
return {
|
||||
success: false,
|
||||
error: error.response?.data?.message || error.message,
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user