생성된 관계도 확인

This commit is contained in:
hyeonsu
2025-09-09 11:35:05 +09:00
parent 989c118ad2
commit 7260ad733b
8 changed files with 1018 additions and 107 deletions

View File

@@ -38,17 +38,17 @@ export interface TableInfo {
}
export interface TableRelationship {
relationshipId?: number;
relationshipName: string;
fromTableName: string;
fromColumnName: string;
toTableName: string;
toColumnName: string;
relationshipType: "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many";
connectionType: "simple-key" | "data-save" | "external-call";
relationship_id?: number;
relationship_name: string;
from_table_name: string;
from_column_name: string;
to_table_name: string;
to_column_name: string;
relationship_type: "one-to-one" | "one-to-many" | "many-to-one" | "many-to-many";
connection_type: "simple-key" | "data-save" | "external-call";
settings?: Record<string, unknown>;
companyCode: string;
isActive?: string;
company_code: string;
is_active?: string;
}
// 데이터 연결 중계 테이블 타입
@@ -87,6 +87,31 @@ export interface TableDataResponse {
};
}
// 관계도 정보 인터페이스
export interface DataFlowDiagram {
diagramName: string;
connectionType: string;
relationshipType: string;
tableCount: number;
relationshipCount: number;
tables: string[];
createdAt: Date;
createdBy: string;
updatedAt: Date;
updatedBy: string;
}
// 관계도 목록 응답 인터페이스
export interface DataFlowDiagramsResponse {
diagrams: DataFlowDiagram[];
total: number;
page: number;
size: number;
totalPages: number;
hasNext: boolean;
hasPrev: boolean;
}
// 테이블 간 데이터 관계 설정 API 클래스
export class DataFlowAPI {
/**
@@ -323,4 +348,51 @@ export class DataFlowAPI {
throw error;
}
}
// ==================== 관계도 관리 ====================
// 관계도 목록 조회
static async getDataFlowDiagrams(
page: number = 1,
size: number = 20,
searchTerm: string = "",
): Promise<DataFlowDiagramsResponse> {
try {
const params = new URLSearchParams({
page: page.toString(),
size: size.toString(),
...(searchTerm && { searchTerm }),
});
const response = await apiClient.get<ApiResponse<DataFlowDiagramsResponse>>(`/dataflow/diagrams?${params}`);
if (!response.data.success) {
throw new Error(response.data.message || "관계도 목록 조회에 실패했습니다.");
}
return response.data.data as DataFlowDiagramsResponse;
} catch (error) {
console.error("관계도 목록 조회 오류:", error);
throw error;
}
}
// 특정 관계도의 모든 관계 조회
static async getDiagramRelationships(diagramName: string): Promise<TableRelationship[]> {
try {
const encodedDiagramName = encodeURIComponent(diagramName);
const response = await apiClient.get<ApiResponse<TableRelationship[]>>(
`/dataflow/diagrams/${encodedDiagramName}/relationships`,
);
if (!response.data.success) {
throw new Error(response.data.message || "관계도 관계 조회에 실패했습니다.");
}
return response.data.data as TableRelationship[];
} catch (error) {
console.error("관계도 관계 조회 오류:", error);
throw error;
}
}
}