-
Notifications
You must be signed in to change notification settings - Fork 0
#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
#172 - 변경된 쪽지 스펙에 맞게 수정 #173
Conversation
There was a problem hiding this 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") |
There was a problem hiding this comment.
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").
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.
|
||
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 |
There was a problem hiding this comment.
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.
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.
1. 🔗 관련 이슈
closes #172
2. 📄 구현한 내용 또는 수정한 내용
제목이 곧 내용입니다.
3. ✅ 배포 Checklist