Skip to content

#134 - 바뀐 인텔리에 따라 스펙을 수정합니다. #166

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 2 commits into from
May 6, 2025

Conversation

kpeel5839
Copy link
Contributor

1. 🔗 관련 이슈

closes #134

2. 📄 구현한 내용 또는 수정한 내용

  • Query로 최대한 효율적으로 해결하려 노력했습니다.

3. ✅ 배포 Checklist

  • 본인을 Assign 해주세요.

@kpeel5839 kpeel5839 requested a review from Copilot May 6, 2025 13:23
@kpeel5839 kpeel5839 self-assigned this May 6, 2025
@kpeel5839 kpeel5839 added 🌱기능🌱 새로운 기능을 추가해요 ! 🏋️매튜🏋️ 24기 김재연 labels May 6, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the message specifications to align with recent changes in the underlying system. Key changes include parameter renaming in the persistence adapter, addition of a new repository query to fetch the latest messages based on a date, and introduction of a new message status API with corresponding service, use case, DTO, and controller.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
infrastructure/mysql/src/main/kotlin/com/wespot/message/v2/MessageV2PersistenceAdapter.kt Renamed parameters and updated calls to use the new variable for clarity.
infrastructure/mysql/src/main/kotlin/com/wespot/message/v2/MessageV2JpaRepository.kt Added a new JPQL query to fetch user messages based on date criteria.
domain/src/main/kotlin/com/wespot/message/v2/MessageV2.kt Exposed a previously private constant and added a helper function for date comparison.
core/src/main/kotlin/com/wespot/message/service/v2/MessageV2UsingStatusService.kt Established a new status service incorporating the updated query and computation of message counts.
core/src/main/kotlin/com/wespot/message/port/in/MessageV2UsingStatusUseCase.kt Defined a new use case interface for the status service.
core/src/main/kotlin/com/wespot/message/dto/response/MessageV2StatusResponse.kt Created a DTO to encapsulate message status responses.
app/src/main/kotlin/com/wespot/message/v2/MessageV2UsingStatusController.kt Introduced a new REST endpoint to expose the message status.
Comments suppressed due to low confidence (1)

infrastructure/mysql/src/main/kotlin/com/wespot/message/v2/MessageV2JpaRepository.kt:52

  • Consider adding parentheses to clarify operator precedence in the OR conditions to ensure the query evaluates as intended.
AND (message.messageRoomId IS NOT NULL AND message.messageRoomId = messageInSubquery.messageRoomId or message.messageRoomId = messageInSubquery.id)

val countTodaySentMessage = messageV2Port.countTodaySendMessages(senderId = loginUser.id)

return MessageV2StatusResponse.of(
isSendAllowed = MessageV2.COUNT_OF_MAX_ABLE_TO_SEND_MESSAGE_PER_DAY == countTodaySentMessage,
Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

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

The logic for determining if sending is allowed appears reversed; consider allowing sending only when countTodaySentMessage is less than COUNT_OF_MAX_ABLE_TO_SEND_MESSAGE_PER_DAY.

Suggested change
isSendAllowed = MessageV2.COUNT_OF_MAX_ABLE_TO_SEND_MESSAGE_PER_DAY == countTodaySentMessage,
isSendAllowed = countTodaySentMessage < MessageV2.COUNT_OF_MAX_ABLE_TO_SEND_MESSAGE_PER_DAY,

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh thanks!!

@kpeel5839 kpeel5839 merged commit 131082f into develop May 6, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱기능🌱 새로운 기능을 추가해요 ! 🏋️매튜🏋️ 24기 김재연
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feature]: 인텔리가 변경됨에 따라 쪽지 현황 API 응답을 수정합니다.
1 participant