Commit graph

6 commits

Author SHA1 Message Date
f483f2cf53 refactor(backend): 트랜잭션 헬퍼, JSON 스키마 추가 및 스키마 파일 분리
- src/utils/transaction.js: withTransaction 헬퍼 함수 추가
- src/schemas/: 도메인별 스키마 파일 분리 (common, album, schedule, admin, member, auth)
- 라우트에 JSON Schema 검증 및 Swagger 문서화 적용
- 트랜잭션 패턴을 withTransaction 헬퍼로 추상화

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 14:58:07 +09:00
2d7d82baf3 refactor(backend): 대형 핸들러 서비스로 분리
- createAlbum, updateAlbum, deleteAlbum 서비스 함수 추가
- insertTracks 배치 삽입 헬퍼 함수
- albums/index.js POST/PUT/DELETE → 서비스 호출로 변경
- routes 파일 80줄 감소

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 14:22:45 +09:00
430bf38c91 refactor(backend): 서비스 레이어 분리
- src/services/album.js 생성: getAlbumDetails, getAlbumsWithTracks
- src/services/schedule.js 생성: getMonthlySchedules, getUpcomingSchedules
- albums/index.js, schedules/index.js에서 서비스 사용으로 변경
- schedules/index.js에서 중복 함수 제거 (240줄 감소)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 13:42:01 +09:00
b61bfe93b4 refactor(backend): 설정 통합 및 N+1 쿼리 최적화
- 카테고리 ID 상수를 config/index.js에 CATEGORY_IDS로 통합
- youtube.js, x.js, schedules/index.js에서 하드코딩된 ID를 상수로 교체
- 앨범 목록 조회 시 N+1 쿼리 문제 해결 (트랙 한 번에 조회)
- 리팩토링 작업 문서 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 13:38:25 +09:00
d4697ad996 refactor: 일정 API source 객체 구조 변경
- source_name, source_url → source: { name, url } 형태로 변경
- YouTube: schedule_youtube에서 video_id로 URL 생성
- X: schedule_x에서 post_id로 URL 생성
- 프론트엔드 전체 파일 source 객체 형태로 수정
- 문서 업데이트 (api.md, architecture.md, migration.md 등)
- tracks → album_tracks 테이블명 변경 반영

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-18 21:50:04 +09:00
b0f7169226 refactor: API 라우트 구조 통합 및 파일 분리
- /api/admin/* + /api/* 분리 구조를 /api/*로 통합
- GET 요청은 공개, POST/PUT/DELETE는 인증 필요로 변경
- albums 라우트를 기능별 파일로 분리 (index, photos, teasers)
- 프론트엔드 API 호출 경로 업데이트

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 13:01:35 +09:00