Skip to content

Commit 9788d28

Browse files
authored
Merge pull request #203 from wespot-bff/feature/flash159483/#202
#202: 프로필 이미지 수정 추가
2 parents 86ee0fa + 57749a2 commit 9788d28

File tree

15 files changed

+161
-216
lines changed

15 files changed

+161
-216
lines changed

app/src/main/kotlin/com/bff/wespot/AppNavGraphs.kt

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import androidx.navigation.NavGraph
1717
import androidx.navigation.NavHostController
1818
import com.bff.wespot.entire.screen.destinations.AccountSettingScreenDestination
1919
import com.bff.wespot.entire.screen.destinations.BlockListScreenDestination
20-
import com.bff.wespot.entire.screen.destinations.CharacterEditScreenDestination
2120
import com.bff.wespot.entire.screen.destinations.EntireScreenDestination
2221
import com.bff.wespot.entire.screen.destinations.NotificationSettingScreenDestination
2322
import com.bff.wespot.entire.screen.destinations.ProfileEditScreenDestination
@@ -99,7 +98,6 @@ object AppNavGraphs {
9998
RevokeScreenDestination,
10099
RevokeConfirmScreenDestination,
101100
ProfileEditScreenDestination,
102-
CharacterEditScreenDestination,
103101
BlockListScreenDestination,
104102
).routedIn(this)
105103
.associateBy { it.route }

app/src/main/kotlin/com/bff/wespot/CommonNavGraphNavigator.kt

+2-9
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ import androidx.navigation.NavController
44
import com.bff.wespot.entire.screen.EntireNavigator
55
import com.bff.wespot.entire.screen.destinations.AccountSettingScreenDestination
66
import com.bff.wespot.entire.screen.destinations.BlockListScreenDestination
7-
import com.bff.wespot.entire.screen.destinations.CharacterEditScreenDestination
87
import com.bff.wespot.entire.screen.destinations.EntireScreenDestination
98
import com.bff.wespot.entire.screen.destinations.NotificationSettingScreenDestination
109
import com.bff.wespot.entire.screen.destinations.ProfileEditScreenDestination
1110
import com.bff.wespot.entire.screen.destinations.RevokeConfirmScreenDestination
1211
import com.bff.wespot.entire.screen.destinations.RevokeScreenDestination
1312
import com.bff.wespot.entire.screen.destinations.SettingScreenDestination
14-
import com.bff.wespot.entire.screen.edit.CharacterEditNavigator
1513
import com.bff.wespot.entire.screen.edit.ProfileEditNavArgs
1614
import com.bff.wespot.entire.screen.edit.ProfileEditNavigator
1715
import com.bff.wespot.entire.screen.setting.AccountSettingNavigator
@@ -21,6 +19,8 @@ import com.bff.wespot.entire.screen.setting.RevokeConfirmNavigator
2119
import com.bff.wespot.entire.screen.setting.RevokeNavigator
2220
import com.bff.wespot.entire.screen.setting.SettingNavigator
2321
import com.bff.wespot.message.screen.MessageNavigator
22+
import com.bff.wespot.message.screen.MessageReportNavigator
23+
import com.bff.wespot.message.screen.MessageReportScreenArgs
2424
import com.bff.wespot.message.screen.MessageScreenArgs
2525
import com.bff.wespot.message.screen.ReservedMessageNavigator
2626
import com.bff.wespot.message.screen.ReservedMessageScreenArgs
@@ -36,8 +36,6 @@ import com.bff.wespot.message.screen.send.MessageWriteNavigator
3636
import com.bff.wespot.message.screen.send.MessageWriteScreenArgs
3737
import com.bff.wespot.message.screen.send.ReceiverSelectionNavigator
3838
import com.bff.wespot.message.screen.send.ReceiverSelectionScreenArgs
39-
import com.bff.wespot.message.screen.MessageReportNavigator
40-
import com.bff.wespot.message.screen.MessageReportScreenArgs
4139
import com.bff.wespot.vote.screen.CharacterSettingNavigator
4240
import com.bff.wespot.vote.screen.IndividualVoteArgs
4341
import com.bff.wespot.vote.screen.IndividualVoteNavigator
@@ -79,7 +77,6 @@ class CommonNavGraphNavigator(
7977
ReservedMessageNavigator,
8078
IndividualVoteNavigator,
8179
ProfileEditNavigator,
82-
CharacterEditNavigator,
8380
CharacterSettingNavigator,
8481
IntroductionNavigator,
8582
MessageReportNavigator {
@@ -167,10 +164,6 @@ class CommonNavGraphNavigator(
167164
navController.navigate(IntroductionScreenDestination(args) within navGraph)
168165
}
169166

170-
override fun navigateToCharacterEditScreen() {
171-
navController.navigate(CharacterEditScreenDestination within navGraph)
172-
}
173-
174167
override fun navigateToProfileEditScreen(args: ProfileEditNavArgs) {
175168
navController.navigate(ProfileEditScreenDestination(args) within navGraph)
176169
}

data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/user/UserDataSource.kt

+2
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,6 @@ interface UserDataSource {
2323
suspend fun updateIntroduction(introduction: IntroductionDto): Result<Unit>
2424

2525
suspend fun updateCharacter(character: ProfileCharacterDto): Result<Unit>
26+
27+
suspend fun updateProfileImage(url: String): Result<Unit>
2628
}

data-remote/src/main/kotlin/com/bff/wespot/data/remote/source/user/UserDataSourceImpl.kt

+9
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,13 @@ class UserDataSourceImpl @Inject constructor(
8282
}
8383
setBody(character)
8484
}
85+
86+
override suspend fun updateProfileImage(url: String): Result<Unit> =
87+
httpClient.safeRequest {
88+
url {
89+
method = HttpMethod.Post
90+
path("api/v1/image/update-profile")
91+
parameter("url", url)
92+
}
93+
}
8594
}

data/src/main/kotlin/com/bff/wespot/data/repository/user/ProfileRepositoryImpl.kt

+7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.bff.wespot.data.repository.user
22

33
import com.bff.wespot.data.local.source.ProfileDataSource
4+
import com.bff.wespot.data.remote.source.user.UserDataSource
45
import com.bff.wespot.domain.repository.user.ProfileRepository
56
import com.bff.wespot.model.user.response.Profile
67
import com.bff.wespot.model.user.response.ProfileCharacter
@@ -9,6 +10,7 @@ import javax.inject.Inject
910

1011
class ProfileRepositoryImpl @Inject constructor(
1112
private val profileDataSource: ProfileDataSource,
13+
private val userDataSource: UserDataSource,
1214
): ProfileRepository {
1315
override val profileDataFlow: Flow<Profile> = profileDataSource.profileDataFlow
1416

@@ -24,4 +26,9 @@ class ProfileRepositoryImpl @Inject constructor(
2426
profileDataSource.updateProfileCharacter(profileCharacter)
2527

2628
override suspend fun clearProfile() = profileDataSource.clearProfile()
29+
30+
override suspend fun updateProfileImage(url: String): Boolean {
31+
val response = userDataSource.updateProfileImage(url)
32+
return response.isSuccess
33+
}
2734
}

designsystem/src/main/kotlin/com/bff/wespot/designsystem/component/modal/WSDialog.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import com.bff.wespot.designsystem.util.OrientationPreviews
2727

2828
@Composable
2929
fun WSDialog(
30-
dialogType: WSDialogType = WSDialogType.TowButton,
30+
dialogType: WSDialogType = WSDialogType.TwoButton,
3131
title: String,
3232
okButtonText: String = "",
3333
cancelButtonText: String = "",
@@ -46,7 +46,7 @@ fun WSDialog(
4646
WSDialogContent(title = title, subTitle = subTitle)
4747

4848
when (dialogType) {
49-
is WSDialogType.TowButton -> {
49+
is WSDialogType.TwoButton -> {
5050
WSDialogTwoButton(
5151
okButtonText = okButtonText,
5252
cancelButtonText = cancelButtonText,
@@ -133,7 +133,7 @@ private fun WSDialogTwoButton(
133133
}
134134

135135
sealed interface WSDialogType {
136-
data object TowButton : WSDialogType
136+
data object TwoButton : WSDialogType
137137
data object OneButton : WSDialogType
138138
}
139139

domain/src/main/kotlin/com/bff/wespot/domain/repository/user/ProfileRepository.kt

+2
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ interface ProfileRepository {
1616
suspend fun updateProfileCharacter(profileCharacter: ProfileCharacter)
1717

1818
suspend fun clearProfile()
19+
20+
suspend fun updateProfileImage(url: String): Boolean
1921
}

domain/src/main/kotlin/com/bff/wespot/domain/usecase/UpdateProfileCharacterUseCase.kt

-20
This file was deleted.

feature/entire/src/main/java/com/bff/wespot/entire/screen/edit/CharacterEditScreen.kt

-93
This file was deleted.

0 commit comments

Comments
 (0)