mirror of
https://github.com/hwanny1128/HGZero.git
synced 2026-06-13 04:49:11 +00:00
작업 중: Meeting AI 통합 개발 진행 상황 저장
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
package com.unicorn.hgzero.meeting.manual;
|
||||
|
||||
import org.springframework.boot.CommandLineRunner;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
|
||||
/**
|
||||
* 테스트 데이터 삽입 스크립트
|
||||
* 실행: ./gradlew :meeting:bootRun --args='--spring.profiles.active=test'
|
||||
*/
|
||||
@SpringBootApplication(scanBasePackages = "com.unicorn.hgzero.meeting")
|
||||
public class InsertTestData {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(InsertTestData.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public CommandLineRunner insertData(JdbcTemplate jdbcTemplate) {
|
||||
return args -> {
|
||||
System.out.println("===== 테스트 데이터 삽입 시작 =====");
|
||||
|
||||
// 1. 참석자 회의록 삽입
|
||||
insertParticipantMinutes(jdbcTemplate);
|
||||
|
||||
// 2. 회의록 섹션 삽입
|
||||
insertMinutesSections(jdbcTemplate);
|
||||
|
||||
// 3. 데이터 확인
|
||||
verifyData(jdbcTemplate);
|
||||
|
||||
System.out.println("===== 테스트 데이터 삽입 완료 =====");
|
||||
};
|
||||
}
|
||||
|
||||
private void insertParticipantMinutes(JdbcTemplate jdbc) {
|
||||
System.out.println("참석자 회의록 삽입 중...");
|
||||
|
||||
String[] inserts = {
|
||||
"INSERT INTO minutes (minutes_id, meeting_id, user_id, title, status, version, created_by, created_at, updated_at) " +
|
||||
"VALUES ('minutes-user1', 'meeting-123', 'user-001', '참석자 홍길동 회의록', 'DRAFT', 1, 'user-001', NOW(), NOW()) " +
|
||||
"ON CONFLICT (minutes_id) DO NOTHING",
|
||||
|
||||
"INSERT INTO minutes (minutes_id, meeting_id, user_id, title, status, version, created_by, created_at, updated_at) " +
|
||||
"VALUES ('minutes-user2', 'meeting-123', 'user-002', '참석자 김철수 회의록', 'DRAFT', 1, 'user-002', NOW(), NOW()) " +
|
||||
"ON CONFLICT (minutes_id) DO NOTHING",
|
||||
|
||||
"INSERT INTO minutes (minutes_id, meeting_id, user_id, title, status, version, created_by, created_at, updated_at) " +
|
||||
"VALUES ('minutes-user3', 'meeting-123', 'user-003', '참석자 이영희 회의록', 'DRAFT', 1, 'user-003', NOW(), NOW()) " +
|
||||
"ON CONFLICT (minutes_id) DO NOTHING"
|
||||
};
|
||||
|
||||
for (String sql : inserts) {
|
||||
jdbc.execute(sql);
|
||||
}
|
||||
|
||||
System.out.println("참석자 회의록 삽입 완료");
|
||||
}
|
||||
|
||||
private void insertMinutesSections(JdbcTemplate jdbc) {
|
||||
System.out.println("회의록 섹션 삽입 중...");
|
||||
|
||||
// 참석자 1 섹션
|
||||
insertSection(jdbc, "minutes-user1", 1, "프로젝트 목표 논의",
|
||||
"고객사 요구사항이 명확하지 않아 추가 미팅 필요. 우선순위는 성능 개선으로 결정.");
|
||||
insertSection(jdbc, "minutes-user1", 2, "기술 스택 검토",
|
||||
"React와 Spring Boot로 진행하기로 결정. DB는 PostgreSQL 사용.");
|
||||
|
||||
// 참석자 2 섹션
|
||||
insertSection(jdbc, "minutes-user2", 1, "프로젝트 목표 논의",
|
||||
"성능 개선이 가장 중요. 응답시간 목표는 200ms 이내로 설정.");
|
||||
insertSection(jdbc, "minutes-user2", 2, "기술 스택 검토",
|
||||
"캐시 전략으로 Redis 도입 검토 필요. 모니터링 도구는 Prometheus 사용.");
|
||||
|
||||
// 참석자 3 섹션
|
||||
insertSection(jdbc, "minutes-user3", 1, "프로젝트 목표 논의",
|
||||
"고객사 담당자와 다음 주 화요일에 추가 미팅 예정. 요구사항 명세서 작성 필요.");
|
||||
insertSection(jdbc, "minutes-user3", 2, "기술 스택 검토",
|
||||
"UI 라이브러리는 Material-UI 사용. 백엔드는 MSA 아키텍처 검토.");
|
||||
|
||||
System.out.println("회의록 섹션 삽입 완료");
|
||||
}
|
||||
|
||||
private void insertSection(JdbcTemplate jdbc, String minutesId, int sectionNum, String title, String content) {
|
||||
String sql = "INSERT INTO minutes_sections (minutes_id, section_number, section_title, content, created_at) " +
|
||||
"SELECT id, ?, ?, ?, NOW() FROM minutes WHERE minutes_id = ? " +
|
||||
"ON CONFLICT DO NOTHING";
|
||||
|
||||
jdbc.update(sql, sectionNum, title, content, minutesId);
|
||||
}
|
||||
|
||||
private void verifyData(JdbcTemplate jdbc) {
|
||||
System.out.println("\n===== 데이터 확인 =====");
|
||||
|
||||
Integer minutesCount = jdbc.queryForObject(
|
||||
"SELECT COUNT(*) FROM minutes WHERE meeting_id = 'meeting-123' AND user_id IS NOT NULL",
|
||||
Integer.class
|
||||
);
|
||||
System.out.println("참석자 회의록 개수: " + minutesCount);
|
||||
|
||||
Integer sectionsCount = jdbc.queryForObject(
|
||||
"SELECT COUNT(*) FROM minutes_sections ms " +
|
||||
"JOIN minutes m ON ms.minutes_id = m.id " +
|
||||
"WHERE m.meeting_id = 'meeting-123'",
|
||||
Integer.class
|
||||
);
|
||||
System.out.println("회의록 섹션 개수: " + sectionsCount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
-- 테스트용 참석자 회의록(minutes) 데이터
|
||||
-- userId가 있는 회의록들 (참석자별 메모)
|
||||
|
||||
-- 참석자 1의 회의록
|
||||
INSERT INTO minutes (minutes_id, meeting_id, user_id, title, status, version, created_by, created_at, updated_at)
|
||||
VALUES ('minutes-user1', 'meeting-123', 'user-001', '참석자 홍길동 회의록', 'DRAFT', 1, 'user-001', NOW(), NOW())
|
||||
ON CONFLICT (minutes_id) DO NOTHING;
|
||||
|
||||
-- 참석자 2의 회의록
|
||||
INSERT INTO minutes (minutes_id, meeting_id, user_id, title, status, version, created_by, created_at, updated_at)
|
||||
VALUES ('minutes-user2', 'meeting-123', 'user-002', '참석자 김철수 회의록', 'DRAFT', 1, 'user-002', NOW(), NOW())
|
||||
ON CONFLICT (minutes_id) DO NOTHING;
|
||||
|
||||
-- 참석자 3의 회의록
|
||||
INSERT INTO minutes (minutes_id, meeting_id, user_id, title, status, version, created_by, created_at, updated_at)
|
||||
VALUES ('minutes-user3', 'meeting-123', 'user-003', '참석자 이영희 회의록', 'DRAFT', 1, 'user-003', NOW(), NOW())
|
||||
ON CONFLICT (minutes_id) DO NOTHING;
|
||||
|
||||
-- minutes_sections 데이터 삽입
|
||||
-- Entity 구조에 맞게 수정: id, minutes_id, type, title, content, "order", verified, locked, locked_by
|
||||
|
||||
-- 참석자 1 (홍길동)의 메모
|
||||
INSERT INTO minutes_sections (id, minutes_id, type, title, content, "order", verified, locked, locked_by, created_at, updated_at)
|
||||
SELECT
|
||||
'section-user1-1',
|
||||
'minutes-user1',
|
||||
'AGENDA',
|
||||
'프로젝트 목표 논의',
|
||||
'고객사 요구사항이 명확하지 않아 추가 미팅 필요. 우선순위는 성능 개선으로 결정.',
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
NULL,
|
||||
NOW(),
|
||||
NOW()
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM minutes_sections WHERE id = 'section-user1-1'
|
||||
);
|
||||
|
||||
INSERT INTO minutes_sections (id, minutes_id, type, title, content, "order", verified, locked, locked_by, created_at, updated_at)
|
||||
SELECT
|
||||
'section-user1-2',
|
||||
'minutes-user1',
|
||||
'AGENDA',
|
||||
'기술 스택 검토',
|
||||
'React와 Spring Boot로 진행하기로 결정. DB는 PostgreSQL 사용.',
|
||||
2,
|
||||
FALSE,
|
||||
FALSE,
|
||||
NULL,
|
||||
NOW(),
|
||||
NOW()
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM minutes_sections WHERE id = 'section-user1-2'
|
||||
);
|
||||
|
||||
-- 참석자 2 (김철수)의 메모
|
||||
INSERT INTO minutes_sections (id, minutes_id, type, title, content, "order", verified, locked, locked_by, created_at, updated_at)
|
||||
SELECT
|
||||
'section-user2-1',
|
||||
'minutes-user2',
|
||||
'AGENDA',
|
||||
'프로젝트 목표 논의',
|
||||
'성능 개선이 가장 중요. 응답시간 목표는 200ms 이내로 설정.',
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
NULL,
|
||||
NOW(),
|
||||
NOW()
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM minutes_sections WHERE id = 'section-user2-1'
|
||||
);
|
||||
|
||||
INSERT INTO minutes_sections (id, minutes_id, type, title, content, "order", verified, locked, locked_by, created_at, updated_at)
|
||||
SELECT
|
||||
'section-user2-2',
|
||||
'minutes-user2',
|
||||
'AGENDA',
|
||||
'기술 스택 검토',
|
||||
'캐시 전략으로 Redis 도입 검토 필요. 모니터링 도구는 Prometheus 사용.',
|
||||
2,
|
||||
FALSE,
|
||||
FALSE,
|
||||
NULL,
|
||||
NOW(),
|
||||
NOW()
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM minutes_sections WHERE id = 'section-user2-2'
|
||||
);
|
||||
|
||||
-- 참석자 3 (이영희)의 메모
|
||||
INSERT INTO minutes_sections (id, minutes_id, type, title, content, "order", verified, locked, locked_by, created_at, updated_at)
|
||||
SELECT
|
||||
'section-user3-1',
|
||||
'minutes-user3',
|
||||
'AGENDA',
|
||||
'프로젝트 목표 논의',
|
||||
'고객사 담당자와 다음 주 화요일에 추가 미팅 예정. 요구사항 명세서 작성 필요.',
|
||||
1,
|
||||
FALSE,
|
||||
FALSE,
|
||||
NULL,
|
||||
NOW(),
|
||||
NOW()
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM minutes_sections WHERE id = 'section-user3-1'
|
||||
);
|
||||
|
||||
INSERT INTO minutes_sections (id, minutes_id, type, title, content, "order", verified, locked, locked_by, created_at, updated_at)
|
||||
SELECT
|
||||
'section-user3-2',
|
||||
'minutes-user3',
|
||||
'AGENDA',
|
||||
'기술 스택 검토',
|
||||
'UI 라이브러리는 Material-UI 사용. 백엔드는 MSA 아키텍처 검토.',
|
||||
2,
|
||||
FALSE,
|
||||
FALSE,
|
||||
NULL,
|
||||
NOW(),
|
||||
NOW()
|
||||
WHERE NOT EXISTS (
|
||||
SELECT 1 FROM minutes_sections WHERE id = 'section-user3-2'
|
||||
);
|
||||
|
||||
-- 확인 쿼리
|
||||
SELECT 'Test data inserted successfully!' as status;
|
||||
SELECT COUNT(*) as minutes_count FROM minutes WHERE meeting_id = 'meeting-123';
|
||||
SELECT COUNT(*) as sections_count FROM minutes_sections;
|
||||
Reference in New Issue
Block a user