Skip to content
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

#217, #219 : 프로필 한줄소개, 이미지 업데이트 API integration 적용해요, Profile 엔티티 수정해요. #221

Merged
merged 18 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
dab1a27
[FIX]#217 : 쪽지 결과 나가기 버튼 end padding 수정
jeongjaino Jan 14, 2025
262235d
[FIX]#217 : 쪽지 신고 완료시, navigate -> navigateUp으로 변경
jeongjaino Jan 14, 2025
d2d5d33
[CHORE]#217 : NotificationSetting State Screen 패키지 -> State 패키지로 변경
jeongjaino Jan 14, 2025
a4b9323
[CHORE]#217 : EntireEdit -> ProfileEdit
jeongjaino Jan 14, 2025
4e62813
[CHORE]#217 : ProfileEditArgument 삭제
jeongjaino Jan 14, 2025
2a6a96a
[CHORE]#217 : EntireEdit -> ProfileEdit
jeongjaino Jan 14, 2025
2665c98
[CHORE]#217 : 한줄소개 업데이트 인터페이스 삭제
jeongjaino Jan 14, 2025
2813d8c
[CHORE]#217 : 한줄소개 업데이트 인터페이스 삭제
jeongjaino Jan 14, 2025
5c4ec4e
[FEATURE]#217 : 프로필 업데이트 API 구현
jeongjaino Jan 14, 2025
3a29122
[CHORE]#217 : 미사용 상태 삭제
jeongjaino Jan 14, 2025
c7736f5
[FEATURE]#217 : 프로필 한줄 소개 / 이미지 업로드 API 통합
jeongjaino Jan 14, 2025
8917d97
[FIX]#217 : 프로필 디자이너 수정 반영
jeongjaino Jan 14, 2025
fac627f
[FIX]#217 : MessageReportScreen 네비게이션 메소드 롤백
jeongjaino Jan 15, 2025
165fa97
[CHORE]#217 : 미사용 ProfileCharacter 로드 메소드 삭제
jeongjaino Jan 15, 2025
49b0434
[CHORE]#217 : 주석 삭제
jeongjaino Jan 15, 2025
3ab20b1
[CHORE]#217 : ProfileCharacter 도메인 모델 주석 추가
jeongjaino Jan 15, 2025
0306dbd
[FEATURE]#217 : 프로필 수정시 로딩 중 버튼 비활성화 설정
jeongjaino Jan 17, 2025
36452df
[CHORE]#217 : 괄호 소거
jeongjaino Jan 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions app/src/main/kotlin/com/bff/wespot/CommonNavGraphNavigator.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import com.bff.wespot.entire.screen.destinations.ProfileEditScreenDestination
import com.bff.wespot.entire.screen.destinations.RevokeConfirmScreenDestination
import com.bff.wespot.entire.screen.destinations.RevokeScreenDestination
import com.bff.wespot.entire.screen.destinations.SettingScreenDestination
import com.bff.wespot.entire.screen.edit.ProfileEditNavArgs
import com.bff.wespot.entire.screen.edit.ProfileEditNavigator
import com.bff.wespot.entire.screen.setting.AccountSettingNavigator
import com.bff.wespot.entire.screen.setting.BlockListNavigator
Expand All @@ -21,7 +20,6 @@ import com.bff.wespot.entire.screen.setting.SettingNavigator
import com.bff.wespot.message.screen.MessageNavigator
import com.bff.wespot.message.screen.MessageReportNavigator
import com.bff.wespot.message.screen.MessageReportScreenArgs
import com.bff.wespot.message.screen.MessageScreenArgs
import com.bff.wespot.message.screen.ReservedMessageNavigator
import com.bff.wespot.message.screen.destinations.MessageEditScreenDestination
import com.bff.wespot.message.screen.destinations.MessageReportScreenDestination
Expand Down Expand Up @@ -150,8 +148,8 @@ class CommonNavGraphNavigator(
navController.navigate(BlockListScreenDestination within navGraph)
}

override fun navigateToProfileEditScreen(args: ProfileEditNavArgs) {
navController.navigate(ProfileEditScreenDestination(args) within navGraph)
override fun navigateToProfileEditScreen() {
navController.navigate(ProfileEditScreenDestination within navGraph)
}

override fun navigateToEntireScreen() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.bff.wespot

import androidx.navigation.NavController
import com.bff.wespot.entire.screen.destinations.ProfileEditScreenDestination
import com.bff.wespot.entire.screen.edit.ProfileEditNavArgs
import com.bff.wespot.message.screen.MessageScreenArgs
import com.bff.wespot.message.screen.destinations.MessageScreenDestination
import com.bff.wespot.message.screen.destinations.ReceiverSelectionScreenDestination
Expand Down Expand Up @@ -64,6 +63,6 @@ class NotificationNavigatorImpl(private val navController: NavController): Notif
}

override fun navigateToProfileEditScreen() {
navController.navigate(ProfileEditScreenDestination(ProfileEditNavArgs(false)) within AppNavGraphs.entire)
navController.navigate(ProfileEditScreenDestination within AppNavGraphs.entire)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package com.bff.wespot.model.user.response

/**
* params [iconUrl] URL of the profile image.
* params [backgroundColor] backgroundColor is no longer used.
*/
data class ProfileCharacter(
val iconUrl: String,
val backgroundColor: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.bff.wespot.data.remote.model.user.request

import kotlinx.serialization.Serializable

@Serializable
data class ProfileUpdateDto(
val introduction: String,
val url: String?,
)
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.bff.wespot.data.remote.source.user

import com.bff.wespot.data.remote.model.user.request.FeatureNotificationSettingDto
import com.bff.wespot.data.remote.model.user.request.IntroductionDto
import com.bff.wespot.data.remote.model.user.request.ProfileUpdateDto
import com.bff.wespot.data.remote.model.user.response.NotificationSettingDto
import com.bff.wespot.data.remote.model.user.response.ProfileCharacterDto
import com.bff.wespot.data.remote.model.user.response.ProfileDto
import com.bff.wespot.data.remote.model.user.response.UserListDto

Expand All @@ -20,9 +19,5 @@ interface UserDataSource {

suspend fun updateNotificationSetting(notificationSetting: NotificationSettingDto): Result<Unit>

suspend fun updateIntroduction(introduction: IntroductionDto): Result<Unit>

suspend fun updateCharacter(character: ProfileCharacterDto): Result<Unit>

suspend fun updateProfileImage(url: String?): Result<Unit>
suspend fun updateProfile(profileUpdateDto: ProfileUpdateDto): Result<Unit>
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package com.bff.wespot.data.remote.source.user

import com.bff.wespot.data.remote.model.user.request.FeatureNotificationSettingDto
import com.bff.wespot.data.remote.model.user.request.IntroductionDto
import com.bff.wespot.data.remote.model.user.request.ProfileUpdateDto
import com.bff.wespot.data.remote.model.user.response.NotificationSettingDto
import com.bff.wespot.data.remote.model.user.response.ProfileCharacterDto
import com.bff.wespot.data.remote.model.user.response.ProfileDto
import com.bff.wespot.data.remote.model.user.response.UserListDto
import com.bff.wespot.network.extensions.safeRequest
Expand Down Expand Up @@ -65,30 +64,12 @@ class UserDataSourceImpl @Inject constructor(
setBody(notificationSetting)
}

override suspend fun updateIntroduction(introduction: IntroductionDto): Result<Unit> =
httpClient.safeRequest {
url {
method = HttpMethod.Put
path("api/v1/users/me")
}
setBody(introduction)
}

override suspend fun updateCharacter(character: ProfileCharacterDto): Result<Unit> =
httpClient.safeRequest {
url {
method = HttpMethod.Put
path("api/v1/users/me")
}
setBody(character)
}

override suspend fun updateProfileImage(url: String?): Result<Unit> =
override suspend fun updateProfile(profileUpdateDto: ProfileUpdateDto): Result<Unit> =
httpClient.safeRequest {
url {
method = HttpMethod.Post
path("api/v1/image/update-profile")
parameter("url", url)
}
setBody(profileUpdateDto)
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.bff.wespot.data.repository.user

import com.bff.wespot.data.local.source.ProfileDataSource
import com.bff.wespot.data.remote.model.user.request.ProfileUpdateDto
import com.bff.wespot.data.remote.source.user.UserDataSource
import com.bff.wespot.domain.repository.user.ProfileRepository
import com.bff.wespot.model.user.response.Profile
Expand All @@ -23,8 +24,14 @@ class ProfileRepositoryImpl @Inject constructor(

override suspend fun clearProfile() = profileDataSource.clearProfile()

override suspend fun updateProfileImage(url: String?): Boolean {
val response = userDataSource.updateProfileImage(url)
return response.isSuccess
}
override suspend fun updateProfile(
introduction: String,
profileImageUrl: String?
): Result<Unit> =
userDataSource.updateProfile(
ProfileUpdateDto(
introduction = introduction,
url = profileImageUrl,
),
)
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
package com.bff.wespot.data.repository.user

import com.bff.wespot.data.mapper.user.toNotificationSettingDto
import com.bff.wespot.data.mapper.user.toProfileCharacterDto
import com.bff.wespot.data.remote.model.user.request.FeatureNotificationSettingDto
import com.bff.wespot.data.remote.model.user.request.IntroductionDto
import com.bff.wespot.data.remote.source.user.UserDataSource
import com.bff.wespot.domain.repository.DataStoreRepository
import com.bff.wespot.domain.repository.user.UserRepository
import com.bff.wespot.domain.util.DataStoreKey
import com.bff.wespot.model.user.response.NotificationSetting
import com.bff.wespot.model.user.response.Profile
import com.bff.wespot.model.user.response.ProfileCharacter
import javax.inject.Inject

class UserRepositoryImpl @Inject constructor(
Expand Down Expand Up @@ -44,10 +41,4 @@ class UserRepositoryImpl @Inject constructor(
notificationSetting: NotificationSetting,
): Result<Unit> =
userDataSource.updateNotificationSetting(notificationSetting.toNotificationSettingDto())

override suspend fun updateIntroduction(introduction: String): Result<Unit> =
userDataSource.updateIntroduction(introduction = IntroductionDto(introduction))

override suspend fun updateCharacter(character: ProfileCharacter): Result<Unit> =
userDataSource.updateCharacter(character.toProfileCharacterDto())
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ interface ProfileRepository {

suspend fun clearProfile()

suspend fun updateProfileImage(url: String?): Boolean
suspend fun updateProfile(introduction: String, profileImageUrl: String?): Result<Unit>
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.bff.wespot.domain.repository.user

import com.bff.wespot.model.user.response.NotificationSetting
import com.bff.wespot.model.user.response.Profile
import com.bff.wespot.model.user.response.ProfileCharacter

interface UserRepository {
suspend fun getProfile(): Result<Profile>
Expand All @@ -12,8 +11,4 @@ interface UserRepository {
suspend fun setFeatureNotificationSetting(isEnableNotification: Boolean): Result<Unit>

suspend fun updateNotificationSetting(notificationSetting: NotificationSetting): Result<Unit>

suspend fun updateIntroduction(introduction: String): Result<Unit>

suspend fun updateCharacter(character: ProfileCharacter): Result<Unit>
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import com.bff.wespot.designsystem.theme.WeSpotThemeManager
import com.bff.wespot.domain.util.RemoteConfigKey
import com.bff.wespot.entire.R
import com.bff.wespot.entire.component.EntireListItem
import com.bff.wespot.entire.screen.edit.ProfileEditNavArgs
import com.bff.wespot.entire.state.EntireAction
import com.bff.wespot.entire.viewmodel.EntireViewModel
import com.bff.wespot.model.user.response.Profile
Expand All @@ -47,7 +46,7 @@ import org.orbitmvi.orbit.compose.collectAsState

interface EntireNavigator {
fun navigateToSetting()
fun navigateToProfileEditScreen(args: ProfileEditNavArgs)
fun navigateToProfileEditScreen()
}

@Destination
Expand All @@ -69,7 +68,7 @@ internal fun EntireScreen(
) {
ProfileContent(
profile = state.profile,
onClick = { navigator.navigateToProfileEditScreen(ProfileEditNavArgs(false)) },
onClick = { navigator.navigateToProfileEditScreen() },
)

Spacer(modifier = Modifier.height(8.dp))
Expand Down
Loading
Loading