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

[refactor #193] 채팅 요청 상태 업데이트 함수 수정 #194

Merged
merged 7 commits into from
Jan 14, 2025

Conversation

hyun2371
Copy link
Member

관련 이슈

📑 작업 상세 내용

  • 네이밍 변경 RejectedChatInquiryDto -> ExpiredChatInquiryDto

    • 만료된 채팅 요청을 조회한 다음 거절하기 때문에 변경하였습니다
    • (조회 당시에는 거절된 상태가 아님)
  • 기존 로직) 상태 비교, createdAt으로 비교

    • 먼저 호출되는 getExpiredChatInquires에서 상태 비교, createdAt을 이미 비교하기 때문에 또 비교하는건 불필요하다 생각하였습니다.
      -> 만료된 채팅 아이디 리스트만 비교하도록 수정
  • 크레딧 반환하고, credit 기록하는 로직 함수로 추출

  • 불필요한 repository 코드 삭제

💫 작업 요약

🔍 중점적으로 리뷰 할 부분

@hyun2371 hyun2371 added the ♻️ refactor 코드 기능 유지하되 코드 변경 label Jan 14, 2025
@hyun2371 hyun2371 requested a review from dudxo January 14, 2025 10:06
@hyun2371 hyun2371 self-assigned this Jan 14, 2025
@hyun2371 hyun2371 linked an issue Jan 14, 2025 that may be closed by this pull request
1 task
Copy link

Code Coverage

Overall Project 84.44% -0.11% 🍏
Files changed 90.48% 🍏

File Coverage
ChatInquiryService.java 93.71% 🍏
ChatInquiryQueryRepositoryImpl.java 72.06% -1.47%
ChatInquiryScheduler.java 0% -80%

Copy link

Test Results

 28 files   28 suites   15s ⏱️
142 tests 140 ✅ 2 💤 0 ❌
143 runs  141 ✅ 2 💤 0 ❌

Results for commit dbb9e4f.

Copy link
Collaborator

@dudxo dudxo left a comment

Choose a reason for hiding this comment

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

고생하셨습니다!

더욱 읽기 편해졌네요!

@@ -4,13 +4,13 @@
import com.dnd.gongmuin.member.domain.Member;
import com.querydsl.core.annotations.QueryProjection;

public record RejectedChatInquiryDto(
public record ExpiredChatInquiryDto(
Copy link
Collaborator

Choose a reason for hiding this comment

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

더 정확한 네이밍이네요!

queryFactory.update(chatInquiry)
.set(chatInquiry.status, InquiryStatus.REJECTED)
.set(chatInquiry.updatedAt, now)
.where(
chatInquiry.createdAt.loe(LocalDateTime.now().minusWeeks(1)),
chatInquiry.status.eq(InquiryStatus.PENDING)
chatInquiry.id.in(expiredChatInquiryIds)
Copy link
Collaborator

Choose a reason for hiding this comment

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

조건절을 개선해서 속도가 더욱 빨라지겠네요 👍

@hyun2371 hyun2371 merged commit 6894e58 into dev Jan 14, 2025
3 checks passed
@hyun2371 hyun2371 deleted the refactor/#193/edit-auto-reject-condition branch January 14, 2025 11:46
dudxo pushed a commit that referenced this pull request Jan 14, 2025
* [rename] : DTO 이름 변경

* [refactor] : 만료된 채팅 요청 아이디를 비교해 상태 변경하도록 수정

* [test] : 아이디를 비교해 상태 변경하도록 수정 -> 테스트 반영

* [refactor] : 스케줄러 함수명 변경

* [feat] : 만료된 채팅 요청 아이디로 벌크 연산 호출

* [test] : 만료된 채팅 요청 아이디로 벌크 연산 -> 테스트 반영

* [refactor] : 로직 변경으로 불필요해진 repository 함수 제거
dudxo added a commit that referenced this pull request Jan 23, 2025
* [feat #191] 인증/인가 문제 확인을 위한 에러 로그 임시 추가

* [chore #191] 인증/인가 임시 로그 추가를 위한 CD 스크립트 수정

* [refactor #193] 채팅 요청 상태 업데이트 함수 수정 (#194)

* [rename] : DTO 이름 변경

* [refactor] : 만료된 채팅 요청 아이디를 비교해 상태 변경하도록 수정

* [test] : 아이디를 비교해 상태 변경하도록 수정 -> 테스트 반영

* [refactor] : 스케줄러 함수명 변경

* [feat] : 만료된 채팅 요청 아이디로 벌크 연산 호출

* [test] : 만료된 채팅 요청 아이디로 벌크 연산 -> 테스트 반영

* [refactor] : 로직 변경으로 불필요해진 repository 함수 제거

* [fix #190] 답변자가 스스로에게 채팅 요청 보낼 수 없도록 수정 (#192)

* [feat] : 채팅 요청 에러 코드 추가

* [feat] : 채팅 요청 에러 검증 로직 추가

* [test] : 채팅 요청 에러 검증 로직 테스트

* [refactor] : 검증 로직 함수 추출

* [chore #191] 인증/인가 임시 로그 추가를 위한 CD 스크립트 수정

* [fix #191] 임시 로그 문법 오류 수정

* [fix #191] JWT 관련 임시 로그 추가

* [feat #191] 임시 stackTrace 로그 제거

* [feat #191] 쿠키 설정 변경

* [fix #191] 쿠키 SameSite 설정 원상복구

* [feat #191] 쿠키 samesite None -> Strict 변경

* [fix #191] 쿠키 도메인 설정 하위 도메인 . 제거

* [feat #191] 통일된 DNS front domain allow-origins 추가

* [chore #191] 오류 해결 후 cd_dev 스크립트 원복

* [fix #191] 쿠키 에러 확인을 위한 임시 로그 제거

---------

Co-authored-by: Son Gahyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♻️ refactor 코드 기능 유지하되 코드 변경
Projects
None yet
Development

Successfully merging this pull request may close these issues.

♻️ 채팅 요청 상태 업데이트 함수 수정
2 participants