Merged
Conversation
There was a problem hiding this comment.
Pull request overview
이 PR은 백엔드 API 응답 구조를 개선하기 위한 두 가지 주요 변경사항을 반영합니다:
- 날짜 필드명을 더 직관적인 이름으로 변경 (
createdDate→createdAt,lastModifiedDate→updatedAt) - 투표 관련 6개 필드를
voteInfo객체로 그룹화하여 구조를 명확히 개선
주요 변경사항:
- 생성된 TypeScript 타입 정의 업데이트 (Orval을 통한 자동 생성)
- 투표 게시판 컴포넌트에서 새로운 API 구조에 맞게 필드 접근 방식 수정
VoteInfo인터페이스 및 관련 타입 추가
Reviewed changes
Copilot reviewed 2 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
apps/web/src/generated/api/models/voteboardSummary.ts |
createdDate/lastModifiedDate를 createdAt/updatedAt으로 변경하고, 6개의 투표 관련 필드를 voteInfo 객체로 그룹화 |
apps/web/src/generated/api/models/voteboardDetailResponse.ts |
투표 게시글 상세 응답 타입에 동일한 날짜 필드명 변경 및 voteInfo 구조 적용 |
apps/web/src/generated/api/models/voteInfo.ts |
투표 정보를 캡슐화하는 새로운 VoteInfo 인터페이스 추가 |
apps/web/src/generated/api/models/voteInfoVoteStatus.ts |
VoteInfo에서 사용되는 투표 상태 enum 타입 정의 추가 (DELETED 상태 포함) |
apps/web/src/generated/api/models/userResponse.ts |
사용자 응답 타입의 날짜 필드명 변경 적용 |
apps/web/src/generated/api/models/index.ts |
새로 추가된 VoteInfo 및 VoteInfoVoteStatus 타입 export |
apps/web/src/app/main/community/votesboard/components/VoteboardForm.tsx |
수정 모드에서 초기 데이터를 설정할 때 voteInfo 객체를 통해 필드 접근하도록 수정 |
apps/web/src/app/main/community/votesboard/components/VoteBoardCard.tsx |
voteInfo 객체에서 필요한 필드들을 구조 분해하여 사용하도록 리팩토링 |
📦 번들 분석 결과📊 번들 크기 요약
🔍 주요 청크 파일 (크기순)🤖 자동 생성된 번들 분석 리포트 |
⚡ Lighthouse 성능 분석 결과📊 전체 평균 점수
📈 측정 현황
📄 페이지별 상세 분석🏠 커뮤니티 페이지:
|
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 74점 |
| ♿ Accessibility | 80점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
👥 창업자 페이지: /main/founder
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 75점 |
| ♿ Accessibility | 87점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
🏡 홈 페이지: /main/home
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 75점 |
| ♿ Accessibility | 91점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
🗺️ 지도 페이지: /main/maps
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 75점 |
| ♿ Accessibility | 87점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
👤 프로필 페이지: /main/profile
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 75점 |
| ♿ Accessibility | 88점 |
| ✅ Best Practices | 100점 |
| 🔍 SEO | 100점 |
📊 상세 분석 보기
🔗 전체 상세 분석 결과
📄 측정된 페이지
- /main/community
- /main/founder
- /main/home
- /main/maps
- /main/profile
모든 페이지에서 성능 측정이 완료되었습니다.
🤖 자동 생성된 Lighthouse 성능 리포트
youdaeng2
approved these changes
Dec 30, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
주요 변경사항
createdDate,lastModifiedDate→createdAt,updatedAtvoteInfo객체로 그룹화🗓️ 1. 날짜 필드명 변경
변경된 응답 필드
모든 엔티티의 날짜 필드가 다음과 같이 변경되었습니다:
createdDatecreatedAtlastModifiedDateupdatedAt영향받는 API
/api/users/**/community/votesboard/**/community/freeboard/**마이그레이션 예시
Before (기존)
After (변경 후)
🗳️ 2. 투표 정보 구조 개선
변경된 응답 구조
투표 관련 필드들이
voteInfo객체로 그룹화되었습니다.Before (기존 구조)
After (새로운 구조)
주요 변경 포인트
✨
voteInfo객체에 포함된 필드🔝 최상위 레벨에 유지된 필드
hasVoted: 사용자의 투표 참여 여부 (사용자별 정보이므로 분리)🔧 프론트엔드 코드 수정 가이드
1️⃣ Orval 타입 재생성
2️⃣ 코드 마이그레이션
날짜 필드 접근 변경
투표 정보 접근 변경
React 컴포넌트 예시
📊 응답 예시
투표 게시글 상세 조회 응답
{ "postId": 1, "author": { "userId": "user-123", "nickname": "투표왕", "address": "서울시 강남구", "userType": "FOUNDER" }, "category": "restaurant", "title": "우리 동네 맛집 투표", "content": "어떤 음식점을 좋아하시나요?", "images": [], "voteOptions": [ { "id": 1, "content": "한식", "sequence": 0, "voteCount": 15, "percentage": 37.5 }, { "id": 2, "content": "중식", "sequence": 1, "voteCount": 10, "percentage": 25.0 } ], "hasVoted": true, "voteInfo": { "selectedOptionIds": [1], "totalVotes": 40, "voteStatus": "IN_PROGRESS", "endTime": "2025-12-31T23:59:59", "allowRevote": true, "allowMultipleChoice": false }, "viewCount": 120, "commentCount": 5, "likeCount": 8, "isLiked": false, "isAuthorized": true, "isAuthor": false, "canEdit": false, "canDelete": false, "createdAt": "2025-01-01T10:00:00", "updatedAt": "2025-01-01T10:00:00" }🎯 체크리스트
프론트엔드에서 다음 항목들을 확인해주세요:
필수 작업
npm run orval또는pnpm orval실행하여 TypeScript 타입 재생성createdDate→createdAt변경 (전체 검색 후 일괄 수정)lastModifiedDate→updatedAt변경 (전체 검색 후 일괄 수정)post.totalVotes→post.voteInfo.totalVotes)hasVoted는 최상위 레벨 유지 확인 (post.hasVoted)테스트
🔍 영향받는 필드 전체 목록
VoteboardDetailResponse 변경사항
totalVotesvoteInfo.totalVotesnumbervoteStatusvoteInfo.voteStatusVoteStatusselectedOptionIdsvoteInfo.selectedOptionIdsnumber[]endTimevoteInfo.endTimestringallowRevotevoteInfo.allowRevotebooleanallowMultipleChoicevoteInfo.allowMultipleChoicebooleanhasVotedhasVotedbooleancreatedDatecreatedAtstringlastModifiedDateupdatedAtstringVoteboardSummary 변경사항
VoteboardDetailResponse와 동일한 구조 변경 적용
💡 팁
1. 일괄 검색 및 수정
VSCode에서 다음 정규식으로 검색하여 일괄 수정 가능:
2. TypeScript 컴파일 에러 활용
Orval로 타입을 재생성한 후, TypeScript 컴파일 에러를 따라가면서 수정하는 것이 가장 안전합니다.