From babd6a87bd37edfe277795ce7e30c04b40d9ab94 Mon Sep 17 00:00:00 2001 From: JAEHYUK LEE <107346845+Hyuk-II@users.noreply.github.com> Date: Tue, 19 Aug 2025 15:19:02 +0900 Subject: [PATCH] =?UTF-8?q?ERD=20=EC=A0=95=EB=B3=B4=EB=A5=BC=20=EC=BD=94?= =?UTF-8?q?=EB=93=9C=EB=A1=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/apis/erd.js | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/src/api/apis/erd.js b/src/api/apis/erd.js index 5243bc0..cb9b43d 100644 --- a/src/api/apis/erd.js +++ b/src/api/apis/erd.js @@ -1,9 +1,31 @@ -import { client } from "../utils/axios.jsx"; +const erd = { + diagrams: [ + { + name: 'Post', + attributes: [ + { name: 'post_id', type: 'INTEGER', primaryKey: true }, + { name: 'user_id', type: 'INTEGER', primaryKey: false } + ] + }, + { + name: 'Get', + attributes: [ + { name: 'user_id', type: 'INTEGER', primaryKey: false }, + { name: 'get_id', type: 'INTEGER', primaryKey: true } + ] + }, + { + name: 'User', + attributes: [ + { name: 'user_name', type: 'VARCHAR', primaryKey: false }, + { name: 'user_id', type: 'INTEGER', primaryKey: true } + ] + } + ], + relationships: [ + { from: 'User.user_id', to: 'Get.user_id', type: 'ONE_TO_MANY' }, + { from: 'User.user_id', to: 'Post.user_id', type: 'ONE_TO_MANY' } + ] +}; -// 조회 (백엔드 스펙에 맞춰 경로 조정: 읽기 전용이면 보통 /api/erd/{teamCode}) -export const getERD = (teamCode) => - client.get(`/api/erd/${encodeURIComponent(teamCode)}`); - -// 수정/저장 -export const updateERD = (teamCode, payload) => - client.post(`/api/erd/update/${encodeURIComponent(teamCode)}`, payload); +export default erd; \ No newline at end of file