Skip to content

#172 - 변경된 쪽지 스펙에 맞게 수정 #173

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

Conversation

kpeel5839
Copy link
Contributor

1. 🔗 관련 이슈

closes #172

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

제목이 곧 내용입니다.

3. ✅ 배포 Checklist

  • 본인을 Assign 해주세요.

@kpeel5839 kpeel5839 requested a review from Copilot May 29, 2025 14:35
@kpeel5839 kpeel5839 self-assigned this May 29, 2025
@kpeel5839 kpeel5839 added 🌱기능🌱 새로운 기능을 추가해요 ! 🔧리팩터링🔧 리팩터링일까요 리팩토링일까요? 🏋️매튜🏋️ 24기 김재연 labels May 29, 2025
@kpeel5839 kpeel5839 merged commit f044185 into develop May 29, 2025
1 of 2 checks passed
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 aligns message-related specs to the updated design by adjusting color validation, enriching message view models, and updating notification/content assets.

  • Extend hex color validation in StringColor to accept 7-character codes.
  • Introduce viewer-based profile accessors in MessageV2 & MessageRoom and refactor overview responses to use a nested profile DTO.
  • Update notification imagery, button text/colors, bump submodule commit, and refresh README title.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
domain/src/main/kotlin/com/wespot/view/color/StringColor.kt Allow both 7- and 9-character hex codes but update error message remains outdated.
domain/src/main/kotlin/com/wespot/message/v2/MessageV2.kt Add my* helper methods for viewer-based profile fields (image, name, school, grade, class).
domain/src/main/kotlin/com/wespot/message/v2/MessageRoom.kt Simplify boolean return, add sender* wrappers around MessageV2 helpers.
domain/src/main/kotlin/com/wespot/common/NotificationTypeToUpdateFeatureContent.kt Swap asset URLs and update button label & background color to match new spec.
core/src/main/kotlin/com/wespot/notification/service/EventNotificationService.kt Clean up imports and reorder EventPublishNotificationService.
core/src/main/kotlin/com/wespot/message/dto/response/MessageV2OverviewResponse.kt Replace flat fields with nested MessageProfileResponse for sender & receiver profiles.
app/src/main/resources/config Bump subproject commit reference.
README.md Change repo heading to "Wespot Backend".

@@ -15,7 +15,7 @@ data class StringColor(
}

private fun validate(color: String) {
if (color.length != 9 || color[0] != '#') {
if ((color.length != 9 && color.length != 7) || color[0] != '#') {
throw CustomException(HttpStatus.BAD_REQUEST, ExceptionView.TOAST, "color length must be 9")
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

The exception message "color length must be 9" is now inaccurate since 7-character hex codes are allowed; update it to reflect both supported lengths (e.g., "color length must be 7 or 9").

Suggested change
throw CustomException(HttpStatus.BAD_REQUEST, ExceptionView.TOAST, "color length must be 9")
throw CustomException(HttpStatus.BAD_REQUEST, ExceptionView.TOAST, "color length must be 7 or 9")

Copilot uses AI. Check for mistakes.

Comment on lines +444 to +509

if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.profile.iconUrl
}

if (isMeAnonymous(viewer)) {
return anonymousProfile!!.imageUrl
}

return sender.profile.iconUrl
}

fun myName(viewer: User): String {
validateRoomMessage()

if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.name
}

if (isMeAnonymous(viewer)) {
return anonymousProfile!!.name
}

return sender.name
}

fun mySchoolName(viewer: User): String? {
validateRoomMessage()

if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.school.name
}

if (isMeAnonymous(viewer)) {
return null
}

return sender.school.name
}

fun myGrade(viewer: User): Int? {
validateRoomMessage()

if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.grade
}

if (isMeAnonymous(viewer)) {
return null
}

return sender.grade
}

fun myClassNumber(viewer: User): Int? {
validateRoomMessage()

if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.classNumber
}

if (isMeAnonymous(viewer)) {
return null
}

return sender.classNumber
Copy link
Preview

Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

[nitpick] These my* methods share the same pattern of branching on receiver, anonymous, or sender; consider extracting a generic helper or using a common accessor to reduce duplication and ease future changes.

Suggested change
if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.profile.iconUrl
}
if (isMeAnonymous(viewer)) {
return anonymousProfile!!.imageUrl
}
return sender.profile.iconUrl
}
fun myName(viewer: User): String {
validateRoomMessage()
if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.name
}
if (isMeAnonymous(viewer)) {
return anonymousProfile!!.name
}
return sender.name
}
fun mySchoolName(viewer: User): String? {
validateRoomMessage()
if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.school.name
}
if (isMeAnonymous(viewer)) {
return null
}
return sender.school.name
}
fun myGrade(viewer: User): Int? {
validateRoomMessage()
if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.grade
}
if (isMeAnonymous(viewer)) {
return null
}
return sender.grade
}
fun myClassNumber(viewer: User): Int? {
validateRoomMessage()
if (viewer.isMeReceiver(receiverId = receiver.id)) {
return receiver.classNumber
}
if (isMeAnonymous(viewer)) {
return null
}
return sender.classNumber
return resolveViewerAttribute(
viewer = viewer,
receiverAttribute = { receiver.profile.iconUrl },
anonymousAttribute = { anonymousProfile!!.imageUrl },
senderAttribute = { sender.profile.iconUrl }
)
}
fun myName(viewer: User): String {
validateRoomMessage()
return resolveViewerAttribute(
viewer = viewer,
receiverAttribute = { receiver.name },
anonymousAttribute = { anonymousProfile!!.name },
senderAttribute = { sender.name }
)
}
fun mySchoolName(viewer: User): String? {
validateRoomMessage()
return resolveViewerAttribute(
viewer = viewer,
receiverAttribute = { receiver.school.name },
anonymousAttribute = { null },
senderAttribute = { sender.school.name }
)
}
fun myGrade(viewer: User): Int? {
validateRoomMessage()
return resolveViewerAttribute(
viewer = viewer,
receiverAttribute = { receiver.grade },
anonymousAttribute = { null },
senderAttribute = { sender.grade }
)
}
fun myClassNumber(viewer: User): Int? {
validateRoomMessage()
return resolveViewerAttribute(
viewer = viewer,
receiverAttribute = { receiver.classNumber },
anonymousAttribute = { null },
senderAttribute = { sender.classNumber }
)

Copilot uses AI. Check for mistakes.

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.

[refactor]: 변경된 쪽지 Overview 화면에 맞춰 Response를 변경합니다.
1 participant