모달창 올리기
This commit is contained in:
@@ -64,7 +64,8 @@ export class DataflowControlService {
|
||||
relationshipId: string,
|
||||
triggerType: "insert" | "update" | "delete",
|
||||
sourceData: Record<string, any>,
|
||||
tableName: string
|
||||
tableName: string,
|
||||
userId: string = "system"
|
||||
): Promise<{
|
||||
success: boolean;
|
||||
message: string;
|
||||
@@ -78,6 +79,7 @@ export class DataflowControlService {
|
||||
triggerType,
|
||||
sourceData,
|
||||
tableName,
|
||||
userId,
|
||||
});
|
||||
|
||||
// 관계도 정보 조회
|
||||
@@ -238,7 +240,8 @@ export class DataflowControlService {
|
||||
const actionResult = await this.executeMultiConnectionAction(
|
||||
action,
|
||||
sourceData,
|
||||
targetPlan.sourceTable
|
||||
targetPlan.sourceTable,
|
||||
userId
|
||||
);
|
||||
|
||||
executedActions.push({
|
||||
@@ -288,7 +291,8 @@ export class DataflowControlService {
|
||||
private async executeMultiConnectionAction(
|
||||
action: ControlAction,
|
||||
sourceData: Record<string, any>,
|
||||
sourceTable: string
|
||||
sourceTable: string,
|
||||
userId: string = "system"
|
||||
): Promise<any> {
|
||||
try {
|
||||
const extendedAction = action as any; // redesigned UI 구조 접근
|
||||
@@ -321,7 +325,8 @@ export class DataflowControlService {
|
||||
targetTable,
|
||||
fromConnection.id,
|
||||
toConnection.id,
|
||||
multiConnService
|
||||
multiConnService,
|
||||
userId
|
||||
);
|
||||
|
||||
case "update":
|
||||
@@ -332,7 +337,8 @@ export class DataflowControlService {
|
||||
targetTable,
|
||||
fromConnection.id,
|
||||
toConnection.id,
|
||||
multiConnService
|
||||
multiConnService,
|
||||
userId
|
||||
);
|
||||
|
||||
case "delete":
|
||||
@@ -343,7 +349,8 @@ export class DataflowControlService {
|
||||
targetTable,
|
||||
fromConnection.id,
|
||||
toConnection.id,
|
||||
multiConnService
|
||||
multiConnService,
|
||||
userId
|
||||
);
|
||||
|
||||
default:
|
||||
@@ -368,7 +375,8 @@ export class DataflowControlService {
|
||||
targetTable: string,
|
||||
fromConnectionId: number,
|
||||
toConnectionId: number,
|
||||
multiConnService: any
|
||||
multiConnService: any,
|
||||
userId: string = "system"
|
||||
): Promise<any> {
|
||||
try {
|
||||
// 필드 매핑 적용
|
||||
@@ -387,6 +395,14 @@ export class DataflowControlService {
|
||||
}
|
||||
}
|
||||
|
||||
// 🆕 변경자 정보 추가
|
||||
if (!mappedData.created_by) {
|
||||
mappedData.created_by = userId;
|
||||
}
|
||||
if (!mappedData.updated_by) {
|
||||
mappedData.updated_by = userId;
|
||||
}
|
||||
|
||||
console.log(`📋 매핑된 데이터:`, mappedData);
|
||||
|
||||
// 대상 연결에 데이터 삽입
|
||||
@@ -421,11 +437,32 @@ export class DataflowControlService {
|
||||
targetTable: string,
|
||||
fromConnectionId: number,
|
||||
toConnectionId: number,
|
||||
multiConnService: any
|
||||
multiConnService: any,
|
||||
userId: string = "system"
|
||||
): Promise<any> {
|
||||
try {
|
||||
// UPDATE 로직 구현 (향후 확장)
|
||||
// 필드 매핑 적용
|
||||
const mappedData: Record<string, any> = {};
|
||||
|
||||
for (const mapping of action.fieldMappings) {
|
||||
const sourceField = mapping.sourceField;
|
||||
const targetField = mapping.targetField;
|
||||
|
||||
if (mapping.defaultValue !== undefined) {
|
||||
mappedData[targetField] = mapping.defaultValue;
|
||||
} else if (sourceField && sourceData[sourceField] !== undefined) {
|
||||
mappedData[targetField] = sourceData[sourceField];
|
||||
}
|
||||
}
|
||||
|
||||
// 🆕 변경자 정보 추가
|
||||
if (!mappedData.updated_by) {
|
||||
mappedData.updated_by = userId;
|
||||
}
|
||||
|
||||
console.log(`📋 UPDATE 매핑된 데이터:`, mappedData);
|
||||
console.log(`⚠️ UPDATE 액션은 향후 구현 예정`);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
message: "UPDATE 액션 실행됨 (향후 구현)",
|
||||
@@ -449,11 +486,11 @@ export class DataflowControlService {
|
||||
targetTable: string,
|
||||
fromConnectionId: number,
|
||||
toConnectionId: number,
|
||||
multiConnService: any
|
||||
multiConnService: any,
|
||||
userId: string = "system"
|
||||
): Promise<any> {
|
||||
try {
|
||||
// DELETE 로직 구현 (향후 확장)
|
||||
console.log(`⚠️ DELETE 액션은 향후 구현 예정`);
|
||||
console.log(`⚠️ DELETE 액션은 향후 구현 예정 (변경자: ${userId})`);
|
||||
return {
|
||||
success: true,
|
||||
message: "DELETE 액션 실행됨 (향후 구현)",
|
||||
@@ -941,7 +978,9 @@ export class DataflowControlService {
|
||||
sourceData: Record<string, any>
|
||||
): Promise<any> {
|
||||
// 보안상 외부 DB에 대한 DELETE 작업은 비활성화
|
||||
throw new Error("보안상 외부 데이터베이스에 대한 DELETE 작업은 허용되지 않습니다. SELECT 쿼리만 사용해주세요.");
|
||||
throw new Error(
|
||||
"보안상 외부 데이터베이스에 대한 DELETE 작업은 허용되지 않습니다. SELECT 쿼리만 사용해주세요."
|
||||
);
|
||||
|
||||
const results = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user