Commit graph

6 commits

Author SHA1 Message Date
3ee41beb46 feat(backend): Redis 캐시 확대 - 카테고리, 앨범 목록/상세 캐싱
캐시 적용:
- 카테고리 목록: 1시간 TTL
- 앨범 목록: 10분 TTL
- 앨범 상세: 10분 TTL

캐시 무효화:
- 앨범 생성/수정/삭제 시 자동 무효화
- invalidateAlbumCache 함수 추가

utils/cache.js:
- TTL 상수 추가 (SHORT, MEDIUM, LONG, VERY_LONG)
- 앨범 관련 캐시 키 추가

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 16:16:09 +09:00
b0ac0e51e4 refactor(backend): 17단계 중복 코드 제거 - 멤버/앨범 조회 서비스 분리
- services/member.js 생성: getAllMembers, getMemberByName, getMemberBasicByName
- services/album.js에 getAlbumByName, getAlbumById 추가
- routes/members/index.js 서비스 호출로 변경 (약 50줄 감소)
- routes/albums/index.js 서비스 호출로 변경

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 15:58:08 +09:00
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
0a91d04992 refactor(backend): 순차 쿼리 → 병렬 처리
- getAlbumDetails: tracks/teasers/photos 쿼리 Promise.all로 병렬 실행
- photos.js: 멤버 INSERT for loop → VALUES 배치 처리

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 14:12:27 +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