Skip to content
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

[Fix] 인기 게시글 프로필 이미지 처리, Querydsl 수정 #202

Merged
merged 4 commits into from
Feb 3, 2025

Conversation

dona722
Copy link
Collaborator

@dona722 dona722 commented Feb 3, 2025

🚀 Pull Request

[Fix] 인기 게시글, 게시글 검색 프로필 이미지 처리, Querydsl 수정

#️⃣ 연관된 이슈

#201

📋 작업 내용

  • 인기 게시글 목록 조회, 게시글 검색 시 프로필 이미지가 안 나오는 오류 수정
  • PostRepository 의 NativeQuery 메서드를 Querydsl 로 수정

🔧 변경된 코드 설명

  • 게시글 목록 조회에 이미지 처리 수정
// 데이터 변환
		List<PostListResponse> data = posts.stream()
			.map(post -> PostListResponse.fromEntity(
				post,
				fileService.getPostThumbnailImgUrl(post.getId()),
				post.getIsAnonymous() ? fileService.getAnonymousProfileImgUrl() :
					fileService.getProfileImgUrl(post.getWriterId())))
			.toList();
  • PostRepositoryCustom 인터페이스 정의:
    • findRegisteredAtByIdQuerydsl(Long id)
    • findLatestPostsByCategoryQuerydsl, findMostViewedPostsByCategoryQuerydsl 등 기타 QueryDSL 메서드 정의.

✅ 테스트 여부

  • 테스트 코드 실행 여부
  • 서버 실행 여부
  • 스웨거 테스트 여부

👽 비고

기타 알림 사항이 있으면 적어주세요.

@dona722 dona722 linked an issue Feb 3, 2025 that may be closed by this pull request
Copy link
Collaborator

@yr0202 yr0202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QPost post = QPost.post; 지역변수로 빼서 사용하면 QPost을 안써도 될 것 같아요~!

@LeeEuyJoon LeeEuyJoon merged commit 78fa2fb into dev Feb 3, 2025
2 checks passed
@dona722 dona722 deleted the fix/posts-list-profile-image--#201 branch February 7, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Fix] 게시글 목록 이미지 수정
4 participants