From 86564d750429f3e9f4547f9ce3dbab5041c989b8 Mon Sep 17 00:00:00 2001 From: Chaejongin12 Date: Mon, 2 Sep 2024 08:45:31 +0900 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=94=A5::=20PostNavigation=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EC=BD=9C=EB=B0=B1=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/msg/post/navigation/PostNavigation.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/feature/post/src/main/java/com/msg/post/navigation/PostNavigation.kt b/feature/post/src/main/java/com/msg/post/navigation/PostNavigation.kt index ee5b80b4..f15e93a4 100644 --- a/feature/post/src/main/java/com/msg/post/navigation/PostNavigation.kt +++ b/feature/post/src/main/java/com/msg/post/navigation/PostNavigation.kt @@ -27,13 +27,11 @@ fun NavController.navigateToPostDetailPage(navOptions: NavOptions? = null) { } fun NavGraphBuilder.postDetailScreen( - // onEditClicked: () -> Unit, onDeleteClicked: () -> Unit, onBackClicked: () -> Unit ) { composable(route = postDetailRoute) { PostDetailScreenRoute( - // onEditClicked = onEditClicked, onDeleteClicked = onDeleteClicked, onBackClicked = onBackClicked ) From ed286a6fbf644c4e953c4af1d7a101167a4f2f5a Mon Sep 17 00:00:00 2001 From: Chaejongin12 Date: Mon, 2 Sep 2024 08:45:46 +0900 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=94=A5::=20PostDetailScreen=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=BD=9C=EB=B0=B1=20=EB=B0=8F=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EB=84=8C=ED=8A=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/msg/post/PostDetailScreen.kt | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/feature/post/src/main/java/com/msg/post/PostDetailScreen.kt b/feature/post/src/main/java/com/msg/post/PostDetailScreen.kt index 809f85fd..d0076019 100644 --- a/feature/post/src/main/java/com/msg/post/PostDetailScreen.kt +++ b/feature/post/src/main/java/com/msg/post/PostDetailScreen.kt @@ -49,7 +49,6 @@ import java.util.UUID @Composable internal fun PostDetailScreenRoute( viewModel: PostViewModel = hiltViewModel(LocalContext.current as ComponentActivity), - // onEditClicked: () -> Unit, onDeleteClicked: () -> Unit, onBackClicked: () -> Unit ) { @@ -69,10 +68,6 @@ internal fun PostDetailScreenRoute( onDeleteClicked() viewModel.deletePost(it) }, -// onEditClicked = { -// onEditClicked() -// viewModel.getFilledEditPage() -// }, onBackClicked = { onBackClicked() viewModel.selectedId.value = UUID.randomUUID() @@ -102,7 +97,6 @@ internal fun PostDetailScreen( id: UUID, role: Authority = Authority.ROLE_USER, onDeleteClicked: (UUID) -> Unit, - // onEditClicked: () -> Unit, onBackClicked: () -> Unit ) { val (isDialogShow, setIsDialogShow) = rememberSaveable { mutableStateOf(false) } @@ -184,16 +178,6 @@ internal fun PostDetailScreen( setIsDialogShow(true) } } - Row( - modifier = modifier.weight(0.45f) - ) { - BitgoeulButton( - modifier = modifier.fillMaxWidth(), - text = "수정하기" - ) { - // onEditClicked() - } - } } } NegativeActionDialog( @@ -224,7 +208,6 @@ fun PostDetailScreenPre() { ), role = Authority.ROLE_ADMIN, onDeleteClicked = {}, - // onEditClicked = {}, id = UUID.randomUUID() ) {} } \ No newline at end of file From 2abbc3c0c4d60ee6d550b456b221784a539cb986 Mon Sep 17 00:00:00 2001 From: Chaejongin12 Date: Mon, 2 Sep 2024 08:46:06 +0900 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=94=A5::=20PostViewModel=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/msg/post/viewmodel/PostViewModel.kt | 39 +------------------ 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/feature/post/src/main/java/com/msg/post/viewmodel/PostViewModel.kt b/feature/post/src/main/java/com/msg/post/viewmodel/PostViewModel.kt index d11b0f38..89a70367 100644 --- a/feature/post/src/main/java/com/msg/post/viewmodel/PostViewModel.kt +++ b/feature/post/src/main/java/com/msg/post/viewmodel/PostViewModel.kt @@ -2,7 +2,6 @@ package com.msg.post.viewmodel import androidx.compose.runtime.mutableStateListOf import androidx.compose.runtime.mutableStateOf -import androidx.lifecycle.SavedStateHandle import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.msg.common.errorhandling.errorHandling @@ -24,11 +23,9 @@ import javax.inject.Inject @HiltViewModel class PostViewModel @Inject constructor( private val deletePostUseCase: DeletePostUseCase, - // private val editPostUseCase: EditPostUseCase, private val getDetailPostUseCase: GetDetailPostUseCase, private val getPostListUseCase: GetPostListUseCase, private val getAuthorityUseCase: GetAuthorityUseCase, - private val savedStateHandle: SavedStateHandle ) : ViewModel() { val role = getRole().toString() @@ -36,9 +33,6 @@ class PostViewModel @Inject constructor( private val _deletePostResponse = MutableStateFlow>(Event.Loading) val deletePostResponse = _deletePostResponse.asStateFlow() - private val _editPostResponse = MutableStateFlow>(Event.Loading) - val editPostResponse = _editPostResponse.asStateFlow() - private val _getDetailPostResponse = MutableStateFlow>(Event.Loading) val getDetailPostResponse = _getDetailPostResponse.asStateFlow() @@ -74,6 +68,7 @@ class PostViewModel @Inject constructor( var isEditPage = mutableStateOf(false) private set + // 아래의 삭제 함수를 저번 PR에서 실수로 삭제 못함 바로 삭제해야함 internal fun deletePost( id: UUID ) = viewModelScope.launch { @@ -88,31 +83,6 @@ class PostViewModel @Inject constructor( } } -// internal fun editPost( -// id: UUID, -// title: String, -// content: String, -// feedType: FeedType -// ) = viewModelScope.launch { -// editPostUseCase( -// id = id, -// body = WritePostParam( -// title = title, -// content = content, -// links = links, -// feedType = feedType -// ) -// ).onSuccess { -// it.catch { remoteError -> -// _editPostResponse.value = remoteError.errorHandling() -// }.collect { -// _editPostResponse.value = Event.Success() -// } -// }.onFailure { error -> -// _editPostResponse.value = error.errorHandling() -// } -// } - internal fun getPostList( type: FeedType ) = viewModelScope.launch { @@ -147,13 +117,6 @@ class PostViewModel @Inject constructor( } } - internal fun getFilledEditPage() { - // onTitleChange(detailPost.value.title) - // onContentChange(detailPost.value.content) - links.addAll(detailPost.value.links) - isEditPage.value = true - } - private fun getRole() = viewModelScope.launch { getAuthorityUseCase() } From 5e5e5daac86bbbac098c145b904da3e78567e201 Mon Sep 17 00:00:00 2001 From: Chaejongin12 Date: Mon, 2 Sep 2024 08:46:20 +0900 Subject: [PATCH 4/8] =?UTF-8?q?=F0=9F=94=A5::=20PostAPI=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../network/src/main/java/com/msg/network/api/PostAPI.kt | 9 --------- .../java/com/msg/lecture/viewmodel/LectureViewModel.kt | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/core/network/src/main/java/com/msg/network/api/PostAPI.kt b/core/network/src/main/java/com/msg/network/api/PostAPI.kt index 0dcf2f2d..e239235e 100644 --- a/core/network/src/main/java/com/msg/network/api/PostAPI.kt +++ b/core/network/src/main/java/com/msg/network/api/PostAPI.kt @@ -3,11 +3,8 @@ package com.msg.network.api import com.msg.model.enumdata.FeedType import com.msg.network.response.post.GetDetailPostResponse import com.msg.network.response.post.GetPostListResponse -import retrofit2.http.Body import retrofit2.http.DELETE import retrofit2.http.GET -import retrofit2.http.PATCH -import retrofit2.http.POST import retrofit2.http.Path import retrofit2.http.Query import java.util.UUID @@ -25,12 +22,6 @@ interface PostAPI { @Path("id") id: UUID ): GetDetailPostResponse -// @PATCH("post/{id}") -// suspend fun editPost( -// @Path("id") id: UUID, -// @Body body: WritePostRequest -// ) - @DELETE("post/{id}") suspend fun deletePost( @Path("id") id: UUID diff --git a/feature/lecture/src/main/java/com/msg/lecture/viewmodel/LectureViewModel.kt b/feature/lecture/src/main/java/com/msg/lecture/viewmodel/LectureViewModel.kt index 061dc147..86c39582 100644 --- a/feature/lecture/src/main/java/com/msg/lecture/viewmodel/LectureViewModel.kt +++ b/feature/lecture/src/main/java/com/msg/lecture/viewmodel/LectureViewModel.kt @@ -56,6 +56,7 @@ class LectureViewModel @Inject constructor( private val _getTakingLectureStudentListResponse = MutableStateFlow>(Event.Loading) val getTakingLectureStudentListResponse = _getTakingLectureStudentListResponse.asStateFlow() + // 네이밍을 editPostResponse에서 editLectureCourseCompletionStatusResponse로 변경해야함 private val _editPostResponse = MutableStateFlow>(Event.Loading) val editPostResponse = _editPostResponse.asStateFlow() From cf0d92bf6ea475eb2acba50cfd190faed1597621 Mon Sep 17 00:00:00 2001 From: Chaejongin12 Date: Mon, 2 Sep 2024 08:46:31 +0900 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=94=A5::=20PostDataSource=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/msg/network/datasource/post/PostDataSource.kt | 1 - .../java/com/msg/network/datasource/post/PostDataSourceImpl.kt | 3 --- 2 files changed, 4 deletions(-) diff --git a/core/network/src/main/java/com/msg/network/datasource/post/PostDataSource.kt b/core/network/src/main/java/com/msg/network/datasource/post/PostDataSource.kt index 80a185eb..aa72f896 100644 --- a/core/network/src/main/java/com/msg/network/datasource/post/PostDataSource.kt +++ b/core/network/src/main/java/com/msg/network/datasource/post/PostDataSource.kt @@ -9,6 +9,5 @@ import java.util.UUID interface PostDataSource { fun getPostList(type: FeedType, size: Int, page: Int): Flow fun getDetailPost(id: UUID): Flow - // fun editPost(id: UUID, body: WritePostRequest): Flow fun deletePost(id: UUID): Flow } \ No newline at end of file diff --git a/core/network/src/main/java/com/msg/network/datasource/post/PostDataSourceImpl.kt b/core/network/src/main/java/com/msg/network/datasource/post/PostDataSourceImpl.kt index 9aec06bc..5683be90 100644 --- a/core/network/src/main/java/com/msg/network/datasource/post/PostDataSourceImpl.kt +++ b/core/network/src/main/java/com/msg/network/datasource/post/PostDataSourceImpl.kt @@ -17,9 +17,6 @@ class PostDataSourceImpl @Inject constructor( override fun getDetailPost(id: UUID): Flow = makeRequest { postAPI.getDetailPost(id = id) } -// override fun editPost(id: UUID, body: WritePostRequest): Flow = -// makeRequest { postAPI.editPost(id = id, body = body) } - override fun deletePost(id: UUID): Flow = makeRequest { postAPI.deletePost(id = id) } } \ No newline at end of file From e9ad35b5e35566bf4730dd4b3c83c6657708e4bc Mon Sep 17 00:00:00 2001 From: Chaejongin12 Date: Mon, 2 Sep 2024 08:46:44 +0900 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=94=A5::=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=EA=B8=80=20=EC=88=98=EC=A0=95=20UseCase=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../msg/domain/usecase/post/EditPostUseCase.kt | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 core/domain/src/main/java/com/msg/domain/usecase/post/EditPostUseCase.kt diff --git a/core/domain/src/main/java/com/msg/domain/usecase/post/EditPostUseCase.kt b/core/domain/src/main/java/com/msg/domain/usecase/post/EditPostUseCase.kt deleted file mode 100644 index 1922253f..00000000 --- a/core/domain/src/main/java/com/msg/domain/usecase/post/EditPostUseCase.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.msg.domain.usecase.post - -//import com.msg.data.repository.post.PostRepository -//import com.msg.model.param.post.WritePostParam -//import java.util.UUID -//import javax.inject.Inject -// -//class EditPostUseCase @Inject constructor( -// private val postRepository: PostRepository -//) { -// suspend operator fun invoke(id: UUID, body: WritePostParam) = runCatching { -// postRepository.editPost( -// id = id, -// body = body -// ) -// } -//} \ No newline at end of file From 5d806f8d6ecd19fc6034080da0bb928219f32a71 Mon Sep 17 00:00:00 2001 From: Chaejongin12 Date: Mon, 2 Sep 2024 08:47:05 +0900 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=94=A5::=20PostRepository=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EA=B8=B0=EB=8A=A5=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/msg/data/repository/post/PostRepository.kt | 1 - .../com/msg/data/repository/post/PostRepositoryImpl.kt | 7 ------- 2 files changed, 8 deletions(-) diff --git a/core/data/src/main/java/com/msg/data/repository/post/PostRepository.kt b/core/data/src/main/java/com/msg/data/repository/post/PostRepository.kt index b3ec8cb9..9b081088 100644 --- a/core/data/src/main/java/com/msg/data/repository/post/PostRepository.kt +++ b/core/data/src/main/java/com/msg/data/repository/post/PostRepository.kt @@ -9,6 +9,5 @@ import java.util.UUID interface PostRepository { fun getPostList(type: FeedType, size: Int, page: Int): Flow fun getDetailPost(id: UUID): Flow - // fun editPost(id: UUID, body: WritePostParam): Flow fun deletePost(id: UUID): Flow } \ No newline at end of file diff --git a/core/data/src/main/java/com/msg/data/repository/post/PostRepositoryImpl.kt b/core/data/src/main/java/com/msg/data/repository/post/PostRepositoryImpl.kt index b28684b7..ef74705d 100644 --- a/core/data/src/main/java/com/msg/data/repository/post/PostRepositoryImpl.kt +++ b/core/data/src/main/java/com/msg/data/repository/post/PostRepositoryImpl.kt @@ -35,13 +35,6 @@ class PostRepositoryImpl @Inject constructor( } } -// override fun editPost(id: UUID, body: WritePostParam): Flow { -// return postDataSource.editPost( -// id = id, -// body = body.toRequest() -// ) -// } - override fun deletePost(id: UUID): Flow { return postDataSource.deletePost(id = id) } From f189b00658724cb00f7f2d8646e72a84b87568c5 Mon Sep 17 00:00:00 2001 From: Chaejongin12 Date: Mon, 2 Sep 2024 08:47:26 +0900 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=94=A5::=20BitgoeulNavHost=20?= =?UTF-8?q?=EA=B2=8C=EC=8B=9C=EA=B8=80=20=EC=88=98=EC=A0=95=20=EB=84=A4?= =?UTF-8?q?=EB=B9=84=EA=B2=8C=EC=9D=B4=EC=85=98=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/msg/bitgoeul_android/navigation/BitgoeulNavHost.kt | 1 - 1 file changed, 1 deletion(-) diff --git a/app/src/main/java/com/msg/bitgoeul_android/navigation/BitgoeulNavHost.kt b/app/src/main/java/com/msg/bitgoeul_android/navigation/BitgoeulNavHost.kt index ae7c8879..6451c6df 100644 --- a/app/src/main/java/com/msg/bitgoeul_android/navigation/BitgoeulNavHost.kt +++ b/app/src/main/java/com/msg/bitgoeul_android/navigation/BitgoeulNavHost.kt @@ -128,7 +128,6 @@ fun BitgoeulNavHost( onItemClick = navController::navigateToPostDetailPage, ) postDetailScreen( - // onEditClicked = navController::navigateToPostAddPage, onDeleteClicked = navController::navigateUp, onBackClicked = navController::navigateUp )