Skip to content

Epic/inquiry#115

Merged
Kyoungwoong merged 14 commits intodevfrom
epic/inquiry
Feb 10, 2025
Merged

Epic/inquiry#115
Kyoungwoong merged 14 commits intodevfrom
epic/inquiry

Conversation

@Kyoungwoong
Copy link
Contributor

@Kyoungwoong Kyoungwoong commented Feb 7, 2025

기능 설명

  • 문의하기 검색 기능 추가

작업 내용

  • 검색 기능을 추가하여 QueryDsl을 수정하였습니다.
  • 이에 따라 DTO도 변경하였습니다.

수정 사항

추가 작업 예정

테스트

  • 단위 테스트 확인(포스트맨 등..)
  • 통합 테스트 확인(서버 빌드되는지 확인)
  • 비정상 입력 시 오류 메시지 확인
  • AWS에 서버 올라가는지 or Swagger 확인

Copy link
Contributor

@Zy0ung Zy0ung left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

Copy link
Contributor

@SangkiHan SangkiHan left a comment

Choose a reason for hiding this comment

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

고생하셨습니다! 말씀드린것만 수정하시면 merge하셔도 될듯합니다!

String keyword,
Pageable pageable) {
QInquiry inquiry = QInquiry.inquiry;
QInquiryAnswer inquiryAnswer = QInquiryAnswer.inquiryAnswer;
Copy link
Contributor

Choose a reason for hiding this comment

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

QClass는 static import 하면 더 깔끔해질수있을거같아요
제가 작업한 NewsQueryRepository참고 부탁드립니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

제가 이해가 잘 안되어서 그런데
혹시

QInquiry inquiry = inquiry;
QInquiryAnswer inquiryAnswer = inquiryAnswer;

이렇게 변경하라는 말씀이신가요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

아 확인했습니다. 수정하겠습니다!

QInquiryAnswer inquiryAnswer = QInquiryAnswer.inquiryAnswer;

// 정렬 조건 설정
OrderSpecifier<?> orderSpecifier = getOrderSpecifier(orderType, inquiry, inquiryAnswer);
Copy link
Contributor

Choose a reason for hiding this comment

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

이런건 하단 orderby에 직접 넣어도 되지 않을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이 두개는 검색 조건입니다!

  • searchType은 검색 조건
  • keyword는 검색어
    입니다

Copy link
Contributor

Choose a reason for hiding this comment

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

아 제말은 메소드를 아래 예시처럼 직접 넣어도 무방하지 않나였습니다.

.where(
  isCategoryEqualTo(category),
  isTitleLikeTo(content)
)
.orderBy(isOrderByEqualToOrderType(orderType))
.offset(pageable.getOffset())
.limit(pageable.getPageSize())

Copy link
Contributor Author

Choose a reason for hiding this comment

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

코드 통일성을 위해 제가 수정하는게 맞는것 같습니다! 수정하겠습니다

testMember = memberRepository.findByPublicId(testMemberPublicId).get();
for (int i = 1; i <= 15; i++) {
inquiryWriteService.createInquiry("문의내역 " + i, testMemberPublicId, "127.0.0.1");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

IntStream.rangeClosed(1, 15).forEach(i -> 
    inquiryWriteService.createInquiry("문의내역 " + i, testMemberPublicId, "127.0.0.1"));

for문안에 로직이 많지 않다면
이런식으로 간결하게 IntStream으로 표현할수있을거같아요!

Copy link
Contributor

Choose a reason for hiding this comment

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

이건 참고만 부탁드립니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

수정하겠습니다!

@Kyoungwoong Kyoungwoong merged commit 3106476 into dev Feb 10, 2025
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.

3 participants