-
Notifications
You must be signed in to change notification settings - Fork 2
feat: 업데이트된 API 적용 (백엔드) #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot wasn't able to review any files in this pull request.
📦 번들 분석 결과📊 번들 크기 요약
🔍 주요 청크 파일 (크기순)🤖 자동 생성된 번들 분석 리포트 |
⚡ Lighthouse 성능 분석 결과📊 전체 평균 점수
📈 측정 현황
📄 페이지별 상세 분석🏠 커뮤니티 페이지:
|
| 지표 | 점수 |
|---|---|
| 🚀 Performance | 70점 |
| ♿ Accessibility | 78점 |
| ✅ 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 3, 2025
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.
📋Summary
자유게시판(Freeboard)과 투표게시판(Voteboard) API의 응답 구조를 개선하여 프론트엔드 사용성을 향상시키고 API 일관성을 확보했습니다.
🎯 완료된 작업 목록
1. 자유게시판 목록 조회 — thumbnailUrl & imageCount 실제 동작 구현
문제점: 기존에는 TODO 주석과 함께 null/0 값만 반환
해결 방법:
변경 파일:
PostRepositoryImpl.java: 서브쿼리 추가FreeboardServiceImpl.java: 실제 값 사용2. 투표게시판 목록 조회 — thumbnailUrl & imageCount 추가
구현 내용:
VotePostSummaryResponse에thumbnailUrl,imageCount필드 추가VotePostMapper에서 이미지 리스트를 sequence 기준으로 정렬하여 첫 번째 이미지 추출변경 파일:
VotePostSummaryResponse.java: 필드 추가VotePostMapper.java: 매핑 로직 구현3. 투표게시판 isLiked/liked 필드 중복 제거
문제점: Lombok의 boolean 타입 getter가
isLiked()와getLiked()두 개를 생성하여 JSON에isLiked와liked모두 포함해결 방법:
@JsonProperty("isLiked")어노테이션 추가boolean→Boolean으로 변경하여 비로그인 사용자는 null 처리변경 파일:
VotePostDetailResponse.javaVotePostSummaryResponse.java4. 투표게시판 상세 조회 — 권한 필드 추가
추가된 필드:
isAuthorized: 액세스 토큰 제공 여부 (인증 상태)isAuthor: 작성자 여부canEdit: 수정 권한 (작성자면 true, 비인증이면 null)canDelete: 삭제 권한 (작성자면 true, 비인증이면 null)변경 파일:
VotePostDetailResponse.java: 필드 추가VotePostMapper.java: 권한 계산 로직 추가VotePostServiceImpl.java: userId 전달5. Swagger 문서 개선 — 투표게시판 상세 조회
개선 내용:
4가지 예시:
isAuthorized: trueisAuthor: truecanEdit: true,canDelete: trueselectedOptionIds: []isAuthorized: trueisAuthor: falsecanEdit: false,canDelete: falseselectedOptionIds: [4, 6]isAuthorized: falseisAuthor: falseisLiked: null,canEdit: null,canDelete: nullvoteStatus: "COMPLETED"변경 파일:
VoteboardController.java:@Operation,@ApiResponses개선6. Orval 타입 호환성 확보
개선 내용:
@Schema어노테이션 명시nullable = true)예시:
📊 테스트 결과
전체 테스트 통과율
주요 테스트 케이스
1. FreeboardServiceTest
2. VoteboardLikeInfoIntegrationTest
3. FreeboardIntegrationTest
🔄 API 응답 변경 사항
자유게시판 목록 조회 (Before → After)
Before
{ "posts": [ { "postId": 123, "title": "테스트 게시글", "thumbnailUrl": null, "imageCount": 0 } ] }After
{ "posts": [ { "postId": 123, "title": "테스트 게시글", "thumbnailUrl": "https://s3.amazonaws.com/bucket/freeboard/image1.jpg", "imageCount": 3, "updatedAt": "2025-01-15T14:30:00" } ] }투표게시판 상세 조회 (Before → After)
Before (인증 사용자)
{ "id": 1, "title": "투표 게시글", "isLiked": false, "liked": false }After (인증 사용자 — 작성자)
{ "id": 1, "title": "투표 게시글", "isLiked": false, "isAuthorized": true, "isAuthor": true, "canEdit": true, "canDelete": true }After (비인증 사용자)
{ "id": 1, "title": "투표 게시판", "isAuthorized": false, "isAuthor": false }Note:
isLiked,canEdit,canDelete는 null이므로 JSON에 포함되지 않음🚀 프론트엔드 영향도
1. 자유게시판 목록
2. 투표게시판 상세