Skip to content

Commit

Permalink
#107 - 프로필 설정 변경 및 welcome 메시지를 변경한다 (#108)
Browse files Browse the repository at this point in the history
* refactor: 프로필 응답 수정

* refactor: message 내용 수정

* test: 테스트 수정

* chore: ddl-auto 변경

* chore: ddl-auto 변경
  • Loading branch information
sectionr0 authored Aug 26, 2024
1 parent 8c20dbf commit a174a00
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion app/src/main/resources/config
6 changes: 2 additions & 4 deletions app/src/test/kotlin/com/wespot/user/fixture/UserFixture.kt
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,8 @@ object UserFixture {
profile: Profile = Profile(0, "black", "image.png"),
) = UpdateProfileRequest(
introduction = introduction,
profile = ProfileRequest(
backgroundColor = profile.backgroundColor,
iconUrl = profile.iconUrl
)
backgroundColor = profile.backgroundColor,
iconUrl = profile.iconUrl
)

fun createUser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ class UserServiceTest : BehaviorSpec({
user.copy(
introduction = profileRequest.introduction?.let { UserIntroduction.from(it) } ?: user.introduction,
profile = profile.copy(
backgroundColor = profileRequest.profile?.backgroundColor ?: user.profile.backgroundColor,
iconUrl = profileRequest.profile?.iconUrl ?: user.profile.iconUrl
backgroundColor = profileRequest.backgroundColor ?: user.profile.backgroundColor,
iconUrl = profileRequest.iconUrl ?: user.profile.iconUrl
)
)
}
Expand All @@ -93,8 +93,8 @@ class UserServiceTest : BehaviorSpec({

then("프로필이 업데이트 되어야 한다") {
user.introduction.introduction shouldBe profileRequest.introduction
user.profile.backgroundColor shouldBe profileRequest.profile?.backgroundColor
user.profile.iconUrl shouldBe profileRequest.profile?.iconUrl
user.profile.backgroundColor shouldBe profileRequest.backgroundColor
user.profile.iconUrl shouldBe profileRequest.iconUrl
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.wespot.user.dto.request

import com.wespot.auth.dto.request.ProfileRequest

data class UpdateProfileRequest(
val introduction: String?,
val profile: ProfileRequest?
val backgroundColor: String?,
val iconUrl: String?,
)
4 changes: 2 additions & 2 deletions core/src/main/kotlin/com/wespot/user/service/UserService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class UserService(
val loginUser = getLoginUser(userPort = userPort)
val updatedIntroduction = profile.introduction ?: loginUser.introduction.introduction
val updatedProfile = loginUser.profile.update(
backgroundColor = profile.profile?.backgroundColor ?: loginUser.profile.backgroundColor,
iconUrl = profile.profile?.iconUrl ?: loginUser.profile.iconUrl
backgroundColor = profile.backgroundColor ?: loginUser.profile.backgroundColor,
iconUrl = profile.iconUrl ?: loginUser.profile.iconUrl
)

val updatedUser = loginUser.copy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ data class MessageContent(
return MessageContent("안녕하세요 ${receiverName}\n" +
"위스팟에 오신 것을 정말 환영해요!\n" +
"\n" +
"제가 큐피트가 되어 000님의 소중한 마음들을 전달해 드릴테니 언제든 익명 쪽지함을 찾아와 주세요!\n" +
"제가 큐피트가 되어 ${receiverName}님의 소중한 마음들을 전달해 드릴테니 언제든 익명 쪽지함을 찾아와 주세요!\n" +
"\n" +
"설레는 시간을 보내시길 바라며..")
}
Expand Down

0 comments on commit a174a00

Please sign in to comment.