From ad0a84f2c3978e3652c708668a4fec8405f2c8fe Mon Sep 17 00:00:00 2001 From: dohyeons Date: Mon, 1 Dec 2025 11:07:35 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EB=8C=80=EC=8B=9C=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=EB=AA=A9=EB=A1=9D=EC=97=90=20=EC=83=9D=EC=84=B1=EC=9E=90=20?= =?UTF-8?q?=EC=BB=AC=EB=9F=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend-node/src/services/DashboardService.ts | 9 +++++++-- .../(main)/admin/dashboard/DashboardListClient.tsx | 12 ++++++++++++ frontend/lib/api/dashboard.ts | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/backend-node/src/services/DashboardService.ts b/backend-node/src/services/DashboardService.ts index 5f3cea61..0d96b285 100644 --- a/backend-node/src/services/DashboardService.ts +++ b/backend-node/src/services/DashboardService.ts @@ -231,7 +231,7 @@ export class DashboardService { const whereClause = whereConditions.join(" AND "); - // 대시보드 목록 조회 (users 테이블 조인 제거) + // 대시보드 목록 조회 (user_info 조인하여 생성자 이름 포함) const dashboardQuery = ` SELECT d.id, @@ -245,13 +245,16 @@ export class DashboardService { d.tags, d.category, d.view_count, + d.company_code, + u.user_name as created_by_name, COUNT(de.id) as elements_count FROM dashboards d LEFT JOIN dashboard_elements de ON d.id = de.dashboard_id + LEFT JOIN user_info u ON d.created_by = u.user_id WHERE ${whereClause} GROUP BY d.id, d.title, d.description, d.thumbnail_url, d.is_public, d.created_by, d.created_at, d.updated_at, d.tags, d.category, - d.view_count + d.view_count, d.company_code, u.user_name ORDER BY d.updated_at DESC LIMIT $${paramIndex} OFFSET $${paramIndex + 1} `; @@ -280,12 +283,14 @@ export class DashboardService { thumbnailUrl: row.thumbnail_url, isPublic: row.is_public, createdBy: row.created_by, + createdByName: row.created_by_name || row.created_by, createdAt: row.created_at, updatedAt: row.updated_at, tags: JSON.parse(row.tags || "[]"), category: row.category, viewCount: parseInt(row.view_count || "0"), elementsCount: parseInt(row.elements_count || "0"), + companyCode: row.company_code, })), pagination: { page, diff --git a/frontend/app/(main)/admin/dashboard/DashboardListClient.tsx b/frontend/app/(main)/admin/dashboard/DashboardListClient.tsx index e7680584..613ab16b 100644 --- a/frontend/app/(main)/admin/dashboard/DashboardListClient.tsx +++ b/frontend/app/(main)/admin/dashboard/DashboardListClient.tsx @@ -195,6 +195,7 @@ export default function DashboardListClient() { 제목 설명 + 생성자 생성일 수정일 작업 @@ -209,6 +210,9 @@ export default function DashboardListClient() {
+ +
+
@@ -277,6 +281,7 @@ export default function DashboardListClient() { 제목 설명 + 생성자 생성일 수정일 작업 @@ -296,6 +301,9 @@ export default function DashboardListClient() { {dashboard.description || "-"} + + {dashboard.createdByName || dashboard.createdBy || "-"} + {formatDate(dashboard.createdAt)} @@ -363,6 +371,10 @@ export default function DashboardListClient() { 설명 {dashboard.description || "-"} +
+ 생성자 + {dashboard.createdByName || dashboard.createdBy || "-"} +
생성일 {formatDate(dashboard.createdAt)} diff --git a/frontend/lib/api/dashboard.ts b/frontend/lib/api/dashboard.ts index c50755b6..11aca0c2 100644 --- a/frontend/lib/api/dashboard.ts +++ b/frontend/lib/api/dashboard.ts @@ -90,6 +90,7 @@ export interface Dashboard { thumbnailUrl?: string; isPublic: boolean; createdBy: string; + createdByName?: string; createdAt: string; updatedAt: string; tags?: string[]; @@ -97,6 +98,7 @@ export interface Dashboard { viewCount: number; elementsCount?: number; creatorName?: string; + companyCode?: string; elements?: DashboardElement[]; settings?: { resolution?: string;