From 9a95c7c8433ce96a95840c010e202d6e9ce27d70 Mon Sep 17 00:00:00 2001 From: kpeel5839 <89840550+kpeel5839@users.noreply.github.com> Date: Thu, 30 Jan 2025 13:48:50 +0900 Subject: [PATCH 1/3] Update README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Readme λ³€κ²½ --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 8a08b5dd..e743a9ba 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -## πŸ–€ μ‚¬λž‘μ˜ Server Repo πŸ–€ +## Wespot Backend [](https://github.com/YAPP-Github/24th-App-Team-1-Android/blob/main/README.md#-kpi%EB%A1%9C-%EA%B5%AD%EC%A0%95%EA%B0%90%EC%82%AC-%EA%B0%80%EB%8A%94-%EA%B7%B8%EB%82%A0%EA%B9%8C%EC%A7%80-%EB%82%98%EC%9D%B8%EC%9B%90-bff-android-) [![](https://private-user-images.githubusercontent.com/77484719/335186351-cfa35f86-a573-4b75-b1db-5ec513035693.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc4NDIyMTEsIm5iZiI6MTcxNzg0MTkxMSwicGF0aCI6Ii83NzQ4NDcxOS8zMzUxODYzNTEtY2ZhMzVmODYtYTU3My00Yjc1LWIxZGItNWVjNTEzMDM1NjkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjA4VDEwMTgzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI3OWZiMDViY2MxNTEyNTk4ZWMxODI1ZGVlYTAwMTA5ZDZmOTg0MDcyNmRmNDk4MjljYTQyYWM4OTg4Zjk0OTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.uhNclo97cwju2GMlJHwGuPl8qMnH54XFuMN7x84Wtsc)](https://private-user-images.githubusercontent.com/77484719/335186351-cfa35f86-a573-4b75-b1db-5ec513035693.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTc4NDIyMTEsIm5iZiI6MTcxNzg0MTkxMSwicGF0aCI6Ii83NzQ4NDcxOS8zMzUxODYzNTEtY2ZhMzVmODYtYTU3My00Yjc1LWIxZGItNWVjNTEzMDM1NjkzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MDglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjA4VDEwMTgzMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI3OWZiMDViY2MxNTEyNTk4ZWMxODI1ZGVlYTAwMTA5ZDZmOTg0MDcyNmRmNDk4MjljYTQyYWM4OTg4Zjk0OTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.uhNclo97cwju2GMlJHwGuPl8qMnH54XFuMN7x84Wtsc) @@ -8,10 +8,8 @@ - -

JaeYeon Kim

πŸ’»

Gicheon Joe

πŸ’»
πŸ‹οΈλ§€νŠœπŸ‹οΈ πŸ₯­λ§κ³ πŸ₯­
From 1ba2c791f074e30d0ef150c34b90550030834613 Mon Sep 17 00:00:00 2001 From: kpeel Date: Thu, 29 May 2025 23:33:51 +0900 Subject: [PATCH 2/3] =?UTF-8?q?refactor:=20=EB=B3=80=EA=B2=BD=EB=90=9C=20?= =?UTF-8?q?=EC=AA=BD=EC=A7=80=20=EC=8A=A4=ED=8E=99=EC=97=90=20=EB=A7=9E?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/response/MessageV2OverviewResponse.kt | 61 +++++++++++++--- .../service/EventNotificationService.kt | 5 +- .../NotificationTypeToUpdateFeatureContent.kt | 8 +-- .../com/wespot/message/v2/MessageRoom.kt | 25 +++++-- .../kotlin/com/wespot/message/v2/MessageV2.kt | 70 +++++++++++++++++++ .../com/wespot/view/color/StringColor.kt | 2 +- 6 files changed, 149 insertions(+), 22 deletions(-) diff --git a/core/src/main/kotlin/com/wespot/message/dto/response/MessageV2OverviewResponse.kt b/core/src/main/kotlin/com/wespot/message/dto/response/MessageV2OverviewResponse.kt index 1fbcabc7..30df4a90 100644 --- a/core/src/main/kotlin/com/wespot/message/dto/response/MessageV2OverviewResponse.kt +++ b/core/src/main/kotlin/com/wespot/message/dto/response/MessageV2OverviewResponse.kt @@ -5,34 +5,75 @@ import java.time.LocalDateTime data class MessageV2OverviewResponse( // TODO : λ¬Έμ„œ λ³€κ²½ val id: Long, + + val senderProfile: MessageProfileResponse, + val isMeMessageRoomOwner: Boolean, - val thumbnail: String, val isExistsUnreadMessage: Boolean, val latestChatTime: LocalDateTime, val isAnonymous: Boolean, - val name: String, - val schoolName: String?, - val grade: Int?, - val classNumber: Int?, + + val receiverProfile: MessageProfileResponse, + val isBookmarked: Boolean, val isBlocked: Boolean, val isEver: Boolean ) { + data class MessageProfileResponse( + val iconUrl: String, + val name: String, + val schoolName: String?, + val grade: Int?, + val classNumber: Int? + ) { + + companion object { + fun of( + iconUrl: String, + name: String, + schoolName: String?, + grade: Int?, + classNumber: Int? + ): MessageProfileResponse { + return MessageProfileResponse( + iconUrl = iconUrl, + name = name, + schoolName = schoolName, + grade = grade, + classNumber = classNumber + ) + } + } + + } + companion object { fun from(room: MessageRoom): MessageV2OverviewResponse { return MessageV2OverviewResponse( id = room.id(), + + senderProfile = MessageProfileResponse.of( + iconUrl = room.senderProfileImage(), + name = room.senderName(), + schoolName = room.senderSchoolName(), + grade = room.senderGrade(), + classNumber = room.senderClassNumber() + ), + isMeMessageRoomOwner = room.isViewerOwnerOfMessageRoom(), - thumbnail = room.receiverProfileImage(), isExistsUnreadMessage = room.isExistsUnReadMessage(), latestChatTime = room.latestChatTime(), isAnonymous = room.isReceiverUsingAnonymous(), - name = room.receiverName(), - schoolName = room.receiverSchoolName(), - grade = room.receiverGrade(), - classNumber = room.receiverClassNumber(), + receiverProfile = MessageProfileResponse.of( + iconUrl = room.receiverProfileImage(), + name = room.receiverName(), + schoolName = room.receiverSchoolName(), + grade = room.receiverGrade(), + classNumber = room.receiverClassNumber() + ), + isBookmarked = room.isBookmarked(), isBlocked = room.isBlocked(), isEver = room.isReceiverEver() diff --git a/core/src/main/kotlin/com/wespot/notification/service/EventNotificationService.kt b/core/src/main/kotlin/com/wespot/notification/service/EventNotificationService.kt index 698ee708..8b869f1b 100644 --- a/core/src/main/kotlin/com/wespot/notification/service/EventNotificationService.kt +++ b/core/src/main/kotlin/com/wespot/notification/service/EventNotificationService.kt @@ -1,14 +1,13 @@ package com.wespot.notification.service import com.wespot.notification.LatestVersionType -import com.wespot.notification.NotificationType import com.wespot.notification.PublishNotificationType import com.wespot.notification.dto.NotificationPublishingRequest import com.wespot.notification.dto.PublishNotificationTypeResponse +import com.wespot.notification.event.EventPublishNotificationService import com.wespot.notification.port.`in`.PublishNotificationUseCase import com.wespot.notification.port.out.LatestVersionPort import com.wespot.notification.port.out.NotificationPort -import com.wespot.notification.event.EventPublishNotificationService import com.wespot.user.port.out.UserPort import com.wespot.user.port.out.UserVersionPort import org.springframework.stereotype.Component @@ -48,7 +47,7 @@ class EventNotificationService( body = notificationPublishingRequest.body ) - notificationPort.saveAll(notifications) + notificationPort.saveAll(notifications) notificationHelper.sendNotifications(users, notifications) } diff --git a/domain/src/main/kotlin/com/wespot/common/NotificationTypeToUpdateFeatureContent.kt b/domain/src/main/kotlin/com/wespot/common/NotificationTypeToUpdateFeatureContent.kt index 9fa7e0b6..0d0e62fb 100644 --- a/domain/src/main/kotlin/com/wespot/common/NotificationTypeToUpdateFeatureContent.kt +++ b/domain/src/main/kotlin/com/wespot/common/NotificationTypeToUpdateFeatureContent.kt @@ -47,13 +47,13 @@ enum class NotificationTypeToUpdateFeatureContent( ), listOf( ImageComponent.of( - "https://dw2d2daekmyur.cloudfront.net/%E1%84%89%E1%85%A5%E1%84%87%E1%85%A5%E1%84%83%E1%85%B3%E1%84%85%E1%85%B5%E1%84%87%E1%85%B3%E1%86%AB_%E1%84%8B%E1%85%A5%E1%86%B8%E1%84%83%E1%85%A6%E1%84%8B%E1%85%B5%E1%84%90%E1%85%B3_%E1%84%8B%E1%85%B5%E1%84%86%E1%85%B5%E1%84%8C%E1%85%B5.png", + "https://dw2d2daekmyur.cloudfront.net/%E1%84%91%E1%85%B3%E1%84%85%E1%85%A9%E1%84%91%E1%85%B5%E1%86%AF_%E1%84%8B%E1%85%A5%E1%86%B8%E1%84%83%E1%85%A6%E1%84%8B%E1%85%B5%E1%84%90%E1%85%B3_%E1%84%89%E1%85%A5%E1%84%87%E1%85%A5%E1%84%83%E1%85%B3%E1%84%85%E1%85%B5%E1%84%87%E1%85%B3%E1%86%AB_UPPER.png", 220, 268, Paddings.of(null, null, 32, null) ), ImageComponent.of( - "https://dw2d2daekmyur.cloudfront.net/%E1%84%89%E1%85%A5%E1%84%87%E1%85%A5%E1%84%83%E1%85%B3%E1%84%85%E1%85%B5%E1%84%87%E1%85%B3%E1%86%AB_%E1%84%8B%E1%85%A5%E1%86%B8%E1%84%83%E1%85%A6%E1%84%8B%E1%85%B5%E1%84%90%E1%85%B3_%E1%84%8B%E1%85%B5%E1%84%86%E1%85%B5%E1%84%8C%E1%85%B5.png", + "https://dw2d2daekmyur.cloudfront.net/%E1%84%91%E1%85%B3%E1%84%85%E1%85%A9%E1%84%91%E1%85%B5%E1%86%AF_%E1%84%8B%E1%85%A5%E1%86%B8%E1%84%83%E1%85%A6%E1%84%8B%E1%85%B5%E1%84%90%E1%85%B3_%E1%84%89%E1%85%A5%E1%84%87%E1%85%A5%E1%84%83%E1%85%B3%E1%84%85%E1%85%B5%E1%84%87%E1%85%B3%E1%86%AB_LOWER.png", 220, 324, Paddings.of(null, null, 118, null) @@ -73,8 +73,8 @@ enum class NotificationTypeToUpdateFeatureContent( "#FF48494C", ), ButtonComponent.ofWithDeepLink( - RichText.of("λ‹€μŒμ— ν•˜κΈ°", "#FFF7F7F8", 16, "Center", "SemiBold"), - "#FF5A5C63", + RichText.of("ν”„λ‘œν•„ μ„€μ •ν•˜κΈ°", "#FFF7F7F8", 16, "Center", "SemiBold"), + "#F6FE8B", "#FF48494C", DeepLink.PROFILE_IMAGE_UPDATE_URL ) diff --git a/domain/src/main/kotlin/com/wespot/message/v2/MessageRoom.kt b/domain/src/main/kotlin/com/wespot/message/v2/MessageRoom.kt index 1e185cee..72763654 100644 --- a/domain/src/main/kotlin/com/wespot/message/v2/MessageRoom.kt +++ b/domain/src/main/kotlin/com/wespot/message/v2/MessageRoom.kt @@ -136,10 +136,7 @@ data class MessageRoom( } fun isSameUserProfileAndNotAnonymous(viewer: User): Boolean { - if (roomMessage.isSameUserProfileAndNotAnonymous(viewer = viewer)) { - return true - } - return false + return roomMessage.isSameUserProfileAndNotAnonymous(viewer = viewer) } fun isSameAnonymousProfile(anonymousProfileId: Long): Boolean { @@ -181,4 +178,24 @@ data class MessageRoom( return messages.readUnreadMessage(viewer = viewer) } + fun senderProfileImage(): String { + return roomMessage.myProfileImage(viewer = viewer) + } + + fun senderName(): String { + return roomMessage.myName(viewer = viewer) + } + + fun senderSchoolName(): String? { + return roomMessage.mySchoolName(viewer = viewer) + } + + fun senderGrade(): Int? { + return roomMessage.myGrade(viewer = viewer) + } + + fun senderClassNumber(): Int? { + return roomMessage.myClassNumber(viewer = viewer) + } + } diff --git a/domain/src/main/kotlin/com/wespot/message/v2/MessageV2.kt b/domain/src/main/kotlin/com/wespot/message/v2/MessageV2.kt index 6009fff3..d4d9eef0 100644 --- a/domain/src/main/kotlin/com/wespot/message/v2/MessageV2.kt +++ b/domain/src/main/kotlin/com/wespot/message/v2/MessageV2.kt @@ -439,6 +439,76 @@ data class MessageV2( return date == createdAt.toLocalDate() } + fun myProfileImage(viewer: User): String { + validateRoomMessage() + + 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 + } + override fun equals(other: Any?): Boolean { if (this === other) return true if (other !is MessageV2) return false diff --git a/domain/src/main/kotlin/com/wespot/view/color/StringColor.kt b/domain/src/main/kotlin/com/wespot/view/color/StringColor.kt index 508da080..8243e4bf 100644 --- a/domain/src/main/kotlin/com/wespot/view/color/StringColor.kt +++ b/domain/src/main/kotlin/com/wespot/view/color/StringColor.kt @@ -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") } From 163ed7ecb09776e6b52a5d1672ffd0316b7a465c Mon Sep 17 00:00:00 2001 From: kpeel Date: Thu, 29 May 2025 23:34:06 +0900 Subject: [PATCH 3/3] =?UTF-8?q?refactor:=20Access=20Token=20Expired=20Time?= =?UTF-8?q?=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/resources/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/resources/config b/app/src/main/resources/config index 9e9867c0..dc397940 160000 --- a/app/src/main/resources/config +++ b/app/src/main/resources/config @@ -1 +1 @@ -Subproject commit 9e9867c078604007349ee099df7d3775b77fe6df +Subproject commit dc3979400e9671345383d79482ab316b1c45f12b