From 25f326bc0c12a1bba858b110259dea57d9a2d240 Mon Sep 17 00:00:00 2001 From: Cat-JiYoung Date: Wed, 19 Jul 2023 07:30:36 +0900 Subject: [PATCH 1/5] =?UTF-8?q?[FEAT]=20=ED=9A=8C=EA=B3=A0=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1=20repository=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../model/response/ResponseReviewTypeDto.kt | 13 +++- .../repository/WriteReviewRepositoryImpl.kt | 63 +++++++++++++++++++ .../source/remote/WriteReviewDataSource.kt | 7 ++- .../remote/impl/WriteReviewDataSourceImpl.kt | 47 ++++++++++++++ .../puzzlingaos/di/DataSourceModule.kt | 6 ++ .../puzzlingaos/di/RepositoryModule.kt | 6 ++ .../repository/WriteReviewRepository.kt | 48 ++++++++++++++ 7 files changed, 185 insertions(+), 5 deletions(-) create mode 100644 app/src/main/java/com/puzzling/puzzlingaos/data/repository/WriteReviewRepositoryImpl.kt create mode 100644 app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/impl/WriteReviewDataSourceImpl.kt create mode 100644 app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt diff --git a/app/src/main/java/com/puzzling/puzzlingaos/data/model/response/ResponseReviewTypeDto.kt b/app/src/main/java/com/puzzling/puzzlingaos/data/model/response/ResponseReviewTypeDto.kt index ec3f51e3..ebddefe1 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/data/model/response/ResponseReviewTypeDto.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/data/model/response/ResponseReviewTypeDto.kt @@ -1,5 +1,6 @@ package com.puzzling.puzzlingaos.data.model.response +import com.puzzling.puzzlingaos.domain.entity.ReviewType import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @@ -20,7 +21,15 @@ data class ResponseReviewTypeDto( val reviewTemplateId: Int, @SerialName("reviewTemplateName") val reviewTemplateName: String, - @SerialName("reviewTempalteMeaning") - val reviewTempalteMeaning: Int, + @SerialName("reviewTemplateMeaning") + val reviewTemplateMeaning: String, ) + + fun toReviewType() = data.map { type -> + ReviewType( + reviewTemplateId = type.reviewTemplateId, + reviewTemplateName = type.reviewTemplateName, + reviewTemplateMeaning = type.reviewTemplateMeaning, + ) + } } diff --git a/app/src/main/java/com/puzzling/puzzlingaos/data/repository/WriteReviewRepositoryImpl.kt b/app/src/main/java/com/puzzling/puzzlingaos/data/repository/WriteReviewRepositoryImpl.kt new file mode 100644 index 00000000..8c281c9b --- /dev/null +++ b/app/src/main/java/com/puzzling/puzzlingaos/data/repository/WriteReviewRepositoryImpl.kt @@ -0,0 +1,63 @@ +package com.puzzling.puzzlingaos.data.repository + +import com.puzzling.puzzlingaos.data.model.request.RequestReview5FDto +import com.puzzling.puzzlingaos.data.model.request.RequestReviewAARDto +import com.puzzling.puzzlingaos.data.model.request.RequestReviewTILDto +import com.puzzling.puzzlingaos.data.model.response.ResponsePreviousTemplateDto +import com.puzzling.puzzlingaos.data.model.response.ResponseSaveReviewDto +import com.puzzling.puzzlingaos.data.source.remote.WriteReviewDataSource +import com.puzzling.puzzlingaos.domain.entity.ReviewType +import com.puzzling.puzzlingaos.domain.repository.WriteReviewRepository +import javax.inject.Inject + +class WriteReviewRepositoryImpl @Inject constructor( + private val writeReviewDataSource: WriteReviewDataSource, +) : WriteReviewRepository { + override suspend fun getReviewType(): Result> = runCatching { + writeReviewDataSource.getReviewTemplate().toReviewType() + } + + override suspend fun uploadTIL( + memberId: Int, + projectId: Int, + requestReviewTIL: RequestReviewTILDto, + ): Result = runCatching { + writeReviewDataSource.uploadReviewTIL( + memberId, + projectId, + requestReviewTIL, + ) + } + + override suspend fun upload5F( + memberId: Int, + projectId: Int, + requestReview5F: RequestReview5FDto, + ): Result = runCatching { + writeReviewDataSource.uploadReview5F( + memberId, + projectId, + requestReview5F, + ) + } + + override suspend fun uploadAAR( + memberId: Int, + projectId: Int, + requestReviewAAR: RequestReviewAARDto, + ): Result = runCatching { + writeReviewDataSource.uploadReviewAAR( + memberId, + projectId, + requestReviewAAR, + ) + } + + override suspend fun getPreviousTemplate( + memberId: Int, + projectId: Int, + ): Result = + runCatching { + writeReviewDataSource.getPreviousTemplate(memberId, projectId) + } +} diff --git a/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/WriteReviewDataSource.kt b/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/WriteReviewDataSource.kt index f1cfbc1b..4018aaf6 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/WriteReviewDataSource.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/WriteReviewDataSource.kt @@ -5,6 +5,7 @@ import com.puzzling.puzzlingaos.data.model.request.RequestReviewAARDto import com.puzzling.puzzlingaos.data.model.request.RequestReviewTILDto import com.puzzling.puzzlingaos.data.model.response.ResponsePreviousTemplateDto import com.puzzling.puzzlingaos.data.model.response.ResponseReviewTypeDto +import com.puzzling.puzzlingaos.data.model.response.ResponseSaveReviewDto interface WriteReviewDataSource { suspend fun getReviewTemplate(): ResponseReviewTypeDto @@ -13,19 +14,19 @@ interface WriteReviewDataSource { memberId: Int, projectId: Int, requestReviewTIL: RequestReviewTILDto, - ): RequestReviewTILDto + ): ResponseSaveReviewDto suspend fun uploadReview5F( memberId: Int, projectId: Int, requestReview5F: RequestReview5FDto, - ): RequestReview5FDto + ): ResponseSaveReviewDto suspend fun uploadReviewAAR( memberId: Int, projectId: Int, requestReviewAAR: RequestReviewAARDto, - ): RequestReviewAARDto + ): ResponseSaveReviewDto suspend fun getPreviousTemplate( memberId: Int, diff --git a/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/impl/WriteReviewDataSourceImpl.kt b/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/impl/WriteReviewDataSourceImpl.kt new file mode 100644 index 00000000..ce187bca --- /dev/null +++ b/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/impl/WriteReviewDataSourceImpl.kt @@ -0,0 +1,47 @@ +package com.puzzling.puzzlingaos.data.source.remote.impl + +import com.puzzling.puzzlingaos.data.model.request.RequestReview5FDto +import com.puzzling.puzzlingaos.data.model.request.RequestReviewAARDto +import com.puzzling.puzzlingaos.data.model.request.RequestReviewTILDto +import com.puzzling.puzzlingaos.data.model.response.ResponsePreviousTemplateDto +import com.puzzling.puzzlingaos.data.model.response.ResponseReviewTypeDto +import com.puzzling.puzzlingaos.data.model.response.ResponseSaveReviewDto +import com.puzzling.puzzlingaos.data.service.WriteReviewService +import com.puzzling.puzzlingaos.data.source.remote.WriteReviewDataSource +import javax.inject.Inject + +class WriteReviewDataSourceImpl @Inject constructor( + private val apiService: WriteReviewService, +) : WriteReviewDataSource { + override suspend fun getReviewTemplate(): ResponseReviewTypeDto = + apiService.getReviewTemplate() + + override suspend fun uploadReviewTIL( + memberId: Int, + projectId: Int, + requestReviewTIL: RequestReviewTILDto, + ): ResponseSaveReviewDto = + apiService.postSaveReviewTIL(memberId, projectId, requestReviewTIL) + + override suspend fun uploadReview5F( + memberId: Int, + projectId: Int, + requestReview5F: RequestReview5FDto, + ): ResponseSaveReviewDto = + apiService.postSaveReview5F(memberId, projectId, requestReview5F) + + override suspend fun uploadReviewAAR( + memberId: Int, + projectId: Int, + requestReviewAAR: RequestReviewAARDto, + ): ResponseSaveReviewDto = + apiService.postSaveReviewAAR(memberId, projectId, requestReviewAAR) + + override suspend fun getPreviousTemplate( + memberId: Int, + projectId: Int, + ): ResponsePreviousTemplateDto = apiService.getPreviousTemplate( + memberId, + projectId, + ) +} diff --git a/app/src/main/java/com/puzzling/puzzlingaos/di/DataSourceModule.kt b/app/src/main/java/com/puzzling/puzzlingaos/di/DataSourceModule.kt index fa0486f3..27247284 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/di/DataSourceModule.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/di/DataSourceModule.kt @@ -1,7 +1,9 @@ package com.puzzling.puzzlingaos.di import com.puzzling.puzzlingaos.data.source.remote.MyDashBoardDataSource +import com.puzzling.puzzlingaos.data.source.remote.WriteReviewDataSource import com.puzzling.puzzlingaos.data.source.remote.impl.MyDashBoardDataSourceImpl +import com.puzzling.puzzlingaos.data.source.remote.impl.WriteReviewDataSourceImpl import dagger.Binds import dagger.Module import dagger.hilt.InstallIn @@ -14,4 +16,8 @@ abstract class DataSourceModule { @Singleton @Binds abstract fun providesPersonalReviewDataSource(DataSourceImpl: MyDashBoardDataSourceImpl): MyDashBoardDataSource + + @Singleton + @Binds + abstract fun providesWriteReviewDataSource(DataSourceImpl: WriteReviewDataSourceImpl): WriteReviewDataSource } diff --git a/app/src/main/java/com/puzzling/puzzlingaos/di/RepositoryModule.kt b/app/src/main/java/com/puzzling/puzzlingaos/di/RepositoryModule.kt index 86c279de..68c8d6c7 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/di/RepositoryModule.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/di/RepositoryModule.kt @@ -1,7 +1,9 @@ package com.puzzling.puzzlingaos.di import com.puzzling.puzzlingaos.data.repository.MyBoardRepositoryImpl +import com.puzzling.puzzlingaos.data.repository.WriteReviewRepositoryImpl import com.puzzling.puzzlingaos.domain.repository.MyBoardRepository +import com.puzzling.puzzlingaos.domain.repository.WriteReviewRepository import dagger.Binds import dagger.Module import dagger.hilt.InstallIn @@ -14,4 +16,8 @@ abstract class RepositoryModule { @Singleton @Binds abstract fun providesMyBoardRepository(repoImpl: MyBoardRepositoryImpl): MyBoardRepository + + @Singleton + @Binds + abstract fun providesWriteReviewRepository(repoImpl: WriteReviewRepositoryImpl): WriteReviewRepository } diff --git a/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt b/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt new file mode 100644 index 00000000..9964b698 --- /dev/null +++ b/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt @@ -0,0 +1,48 @@ +package com.puzzling.puzzlingaos.domain.repository + +import com.puzzling.puzzlingaos.data.model.request.RequestReview5FDto +import com.puzzling.puzzlingaos.data.model.request.RequestReviewAARDto +import com.puzzling.puzzlingaos.data.model.request.RequestReviewTILDto +import com.puzzling.puzzlingaos.data.model.response.ResponsePreviousTemplateDto +import com.puzzling.puzzlingaos.data.model.response.ResponseSaveReviewDto +import com.puzzling.puzzlingaos.domain.entity.ReviewType + +interface WriteReviewRepository { + suspend fun getReviewType(): Result> + + suspend fun uploadTIL( + memberId: Int, + projectId: Int, + requestReviewTIL: RequestReviewTILDto, + ): Result + + suspend fun upload5F( + memberId: Int, + projectId: Int, + requestReview5F: RequestReview5FDto, +// reviewTemplateId: Int, +// fact: String, +// feeling: String, +// finding: String, +// feedback: String, +// actionPlan: String, + ): Result + + suspend fun uploadAAR( + memberId: Int, + projectId: Int, + requestReviewAAR: RequestReviewAARDto, + +// reviewTemplateId: Int, +// initialGoal: String, +// result: String, +// difference: String, +// persistence: String, +// actionPlan: String, + ): Result + + suspend fun getPreviousTemplate( + memberId: Int, + projectId: Int, + ): Result +} From 2d37dd35136a2657fda80fc5dfe1009dbc7b5d5a Mon Sep 17 00:00:00 2001 From: Cat-JiYoung Date: Wed, 19 Jul 2023 07:46:36 +0900 Subject: [PATCH 2/5] =?UTF-8?q?[REFACTOR]=20=ED=9A=8C=EA=B3=A0=20=EC=9E=91?= =?UTF-8?q?=EC=84=B1=20=EB=B7=B0=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...seRetrospectiveFragment.kt => ChooseReviewFragment.kt} | 8 ++++---- .../presentation/writeRetrospective/Write5fFragment.kt | 4 ++-- .../presentation/writeRetrospective/WriteAarFragment.kt | 2 +- .../writeRetrospective/WriteRetrospectiveActivity.kt | 6 +++--- ...eRetrospectiveViewModel.kt => WriteReviewViewModel.kt} | 2 +- .../presentation/writeRetrospective/WriteTilFragment.kt | 4 ++-- app/src/main/res/layout/activity_write_retrospective.xml | 2 +- ...hoose_retrospective.xml => fragment_choose_review.xml} | 0 app/src/main/res/layout/fragment_write5f.xml | 2 +- app/src/main/res/layout/fragment_write_aar.xml | 2 +- app/src/main/res/layout/fragment_write_til.xml | 2 +- 11 files changed, 17 insertions(+), 17 deletions(-) rename app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/{ChooseRetrospectiveFragment.kt => ChooseReviewFragment.kt} (75%) rename app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/{WriteRetrospectiveViewModel.kt => WriteReviewViewModel.kt} (99%) rename app/src/main/res/layout/{fragment_choose_retrospective.xml => fragment_choose_review.xml} (100%) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseRetrospectiveFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseReviewFragment.kt similarity index 75% rename from app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseRetrospectiveFragment.kt rename to app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseReviewFragment.kt index 75e3146f..3bcfe5c7 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseRetrospectiveFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseReviewFragment.kt @@ -5,11 +5,11 @@ import android.view.View import androidx.fragment.app.activityViewModels import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BottomSheetDialogFragment -import com.puzzling.puzzlingaos.databinding.FragmentChooseRetrospectiveBinding +import com.puzzling.puzzlingaos.databinding.FragmentChooseReviewBinding -class ChooseRetrospectiveFragment : - BottomSheetDialogFragment(R.layout.fragment_choose_retrospective) { - private val viewModel by activityViewModels() +class ChooseReviewFragment : + BottomSheetDialogFragment(R.layout.fragment_choose_review) { + private val viewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/Write5fFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/Write5fFragment.kt index 0b1b53e1..1eec0499 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/Write5fFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/Write5fFragment.kt @@ -5,11 +5,11 @@ import androidx.lifecycle.MutableLiveData import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BaseFragment import com.puzzling.puzzlingaos.databinding.FragmentWrite5fBinding -import com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteRetrospectiveViewModel +import com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteReviewViewModel class Write5fFragment : BaseFragment(R.layout.fragment_write5f) { - private val viewModel by activityViewModels() + private val viewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteAarFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteAarFragment.kt index 963b8566..ec04831e 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteAarFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteAarFragment.kt @@ -10,7 +10,7 @@ import com.puzzling.puzzlingaos.databinding.FragmentWriteAarBinding class WriteAarFragment : BaseFragment(R.layout.fragment_write_aar) { - private val viewModel by activityViewModels() + private val viewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveActivity.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveActivity.kt index 8a394689..987ca23a 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveActivity.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveActivity.kt @@ -13,7 +13,7 @@ import com.puzzling.puzzlingaos.databinding.ActivityWriteRetrospectiveBinding class WriteRetrospectiveActivity : BaseActivity(R.layout.activity_write_retrospective) { - private val viewModel by viewModels() + private val viewModel by viewModels() override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -34,8 +34,8 @@ class WriteRetrospectiveActivity : private fun clickBtn() { with(binding) { clWriteChip.setOnClickListener { - val chooseRetrospectiveFragment = ChooseRetrospectiveFragment() - chooseRetrospectiveFragment.show(supportFragmentManager, "show") + val chooseReviewFragment = ChooseReviewFragment() + chooseReviewFragment.show(supportFragmentManager, "show") } tvWriteRegister.setOnClickListener { if (viewModel.isInputEnabled.value == true) { diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveViewModel.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt similarity index 99% rename from app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveViewModel.kt rename to app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt index 47240ce3..e4eabbc6 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveViewModel.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt @@ -6,7 +6,7 @@ import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel -class WriteRetrospectiveViewModel : ViewModel() { +class WriteReviewViewModel : ViewModel() { private val registerRegex = WRITE_REGEX.toRegex() val tilQuestion1 = MutableLiveData() diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteTilFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteTilFragment.kt index f4e80eb6..377415d6 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteTilFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteTilFragment.kt @@ -5,11 +5,11 @@ import androidx.lifecycle.MutableLiveData import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BaseFragment import com.puzzling.puzzlingaos.databinding.FragmentWriteTilBinding -import com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteRetrospectiveViewModel +import com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteReviewViewModel class WriteTilFragment : BaseFragment(R.layout.fragment_write_til) { - private val viewModel by activityViewModels() + private val viewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) diff --git a/app/src/main/res/layout/activity_write_retrospective.xml b/app/src/main/res/layout/activity_write_retrospective.xml index fb7b7390..89828981 100644 --- a/app/src/main/res/layout/activity_write_retrospective.xml +++ b/app/src/main/res/layout/activity_write_retrospective.xml @@ -7,7 +7,7 @@ + type="com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteReviewViewModel" /> diff --git a/app/src/main/res/layout/fragment_choose_retrospective.xml b/app/src/main/res/layout/fragment_choose_review.xml similarity index 100% rename from app/src/main/res/layout/fragment_choose_retrospective.xml rename to app/src/main/res/layout/fragment_choose_review.xml diff --git a/app/src/main/res/layout/fragment_write5f.xml b/app/src/main/res/layout/fragment_write5f.xml index 3ab9cd44..52005ede 100644 --- a/app/src/main/res/layout/fragment_write5f.xml +++ b/app/src/main/res/layout/fragment_write5f.xml @@ -7,7 +7,7 @@ + type="com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteReviewViewModel" /> diff --git a/app/src/main/res/layout/fragment_write_aar.xml b/app/src/main/res/layout/fragment_write_aar.xml index 02c8f69e..d38c0340 100644 --- a/app/src/main/res/layout/fragment_write_aar.xml +++ b/app/src/main/res/layout/fragment_write_aar.xml @@ -7,7 +7,7 @@ + type="com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteReviewViewModel" /> diff --git a/app/src/main/res/layout/fragment_write_til.xml b/app/src/main/res/layout/fragment_write_til.xml index 25a0ca25..b290c77b 100644 --- a/app/src/main/res/layout/fragment_write_til.xml +++ b/app/src/main/res/layout/fragment_write_til.xml @@ -7,7 +7,7 @@ + type="com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteReviewViewModel" /> From d834e234061d76f50bbb6e9c8a5d7f8d0322704b Mon Sep 17 00:00:00 2001 From: Cat-JiYoung Date: Wed, 19 Jul 2023 17:19:49 +0900 Subject: [PATCH 3/5] =?UTF-8?q?[FEAT]=20=ED=9A=8C=EA=B3=A0=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=EB=B3=84=20=EC=A0=80=EC=9E=A5=20=EC=84=9C=EB=B2=84?= =?UTF-8?q?=ED=86=B5=EC=8B=A0=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../response/ResponseMyPuzzleBoardDto.kt | 2 + .../repository/WriteReviewRepositoryImpl.kt | 1 + .../source/remote/WriteReviewDataSource.kt | 2 + .../com/puzzling/puzzlingaos/di/ApiModule.kt | 6 + .../puzzling/puzzlingaos/di/RetrofitModule.kt | 2 +- .../puzzling/puzzlingaos/domain/entity/AAR.kt | 10 ++ .../puzzling/puzzlingaos/domain/entity/F5.kt | 11 ++ .../puzzling/puzzlingaos/domain/entity/TIL.kt | 8 + .../repository/WriteReviewRepository.kt | 1 + .../presentation/home/HomeViewModel.kt | 3 +- .../personal/PersonalDashboardViewModel.kt | 5 +- .../main/HomeChooseProjectFragment.kt | 2 + .../ChooseReviewFragment.kt | 3 + .../RegisterDialogFragment.kt | 14 +- .../writeRetrospective/Write5fFragment.kt | 5 +- .../writeRetrospective/WriteAarFragment.kt | 2 + .../WriteRetrospectiveActivity.kt | 83 +++++++-- .../WriteReviewViewModel.kt | 167 +++++++++++++++++- .../writeRetrospective/WriteTilFragment.kt | 5 +- .../puzzling/puzzlingaos/util/Constants.kt | 6 + .../res/layout/fragment_choose_review.xml | 21 ++- 21 files changed, 327 insertions(+), 32 deletions(-) create mode 100644 app/src/main/java/com/puzzling/puzzlingaos/domain/entity/AAR.kt create mode 100644 app/src/main/java/com/puzzling/puzzlingaos/domain/entity/F5.kt create mode 100644 app/src/main/java/com/puzzling/puzzlingaos/domain/entity/TIL.kt create mode 100644 app/src/main/java/com/puzzling/puzzlingaos/util/Constants.kt diff --git a/app/src/main/java/com/puzzling/puzzlingaos/data/model/response/ResponseMyPuzzleBoardDto.kt b/app/src/main/java/com/puzzling/puzzlingaos/data/model/response/ResponseMyPuzzleBoardDto.kt index bc33a3a9..5ea0b698 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/data/model/response/ResponseMyPuzzleBoardDto.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/data/model/response/ResponseMyPuzzleBoardDto.kt @@ -21,6 +21,8 @@ data class ResponseMyPuzzleBoardDto( val myPuzzle: MyPuzzle, @SerialName("userPuzzleBoard") val userPuzzleBoard: List, + @SerialName("puzzleBoardCount") + val puzzleBoardCount: Int, @SerialName("isReviewDay") val isReviewDay: Boolean, @SerialName("hasTodayReview") diff --git a/app/src/main/java/com/puzzling/puzzlingaos/data/repository/WriteReviewRepositoryImpl.kt b/app/src/main/java/com/puzzling/puzzlingaos/data/repository/WriteReviewRepositoryImpl.kt index 8c281c9b..19ce8a6f 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/data/repository/WriteReviewRepositoryImpl.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/data/repository/WriteReviewRepositoryImpl.kt @@ -21,6 +21,7 @@ class WriteReviewRepositoryImpl @Inject constructor( memberId: Int, projectId: Int, requestReviewTIL: RequestReviewTILDto, + ): Result = runCatching { writeReviewDataSource.uploadReviewTIL( memberId, diff --git a/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/WriteReviewDataSource.kt b/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/WriteReviewDataSource.kt index 4018aaf6..58cc5a36 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/WriteReviewDataSource.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/data/source/remote/WriteReviewDataSource.kt @@ -14,6 +14,8 @@ interface WriteReviewDataSource { memberId: Int, projectId: Int, requestReviewTIL: RequestReviewTILDto, +// requestTIL: TIL, + ): ResponseSaveReviewDto suspend fun uploadReview5F( diff --git a/app/src/main/java/com/puzzling/puzzlingaos/di/ApiModule.kt b/app/src/main/java/com/puzzling/puzzlingaos/di/ApiModule.kt index 4994f939..ed0d20e7 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/di/ApiModule.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/di/ApiModule.kt @@ -1,6 +1,7 @@ package com.puzzling.puzzlingaos.di import com.puzzling.puzzlingaos.data.service.PersonalReviewService +import com.puzzling.puzzlingaos.data.service.WriteReviewService import dagger.Module import dagger.Provides import dagger.hilt.InstallIn @@ -15,4 +16,9 @@ object ApiModule { @Singleton fun provideMyDashBoardService(@PuzzlingRetrofit retrofit: Retrofit): PersonalReviewService = retrofit.create(PersonalReviewService::class.java) + + @Provides + @Singleton + fun provideWriteReviewService(@PuzzlingRetrofit retrofit: Retrofit): WriteReviewService = + retrofit.create(WriteReviewService::class.java) } diff --git a/app/src/main/java/com/puzzling/puzzlingaos/di/RetrofitModule.kt b/app/src/main/java/com/puzzling/puzzlingaos/di/RetrofitModule.kt index c986749f..d67fddf1 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/di/RetrofitModule.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/di/RetrofitModule.kt @@ -67,7 +67,7 @@ object RetrofitModule { val builder = original.newBuilder() builder.addHeader( "Authorization", - "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2ODk2MjA3OTMsImV4cCI6MTY4OTk4MDc5MywibWVtYmVySWQiOjF9.oJu8gFirmwwhwZyWKiqdLwZbZEE_ICqQHTyAqLDaMoE", + "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2ODk3NTAxMTIsImV4cCI6MTY5MDExMDExMiwibWVtYmVySWQiOjJ9.cObREoCFGC8jgcBJjz0z7Bnb03KfP_Fzzup9Oge1tYA", ) chain.proceed(builder.build()) } diff --git a/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/AAR.kt b/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/AAR.kt new file mode 100644 index 00000000..bcc50c7b --- /dev/null +++ b/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/AAR.kt @@ -0,0 +1,10 @@ +package com.puzzling.puzzlingaos.domain.entity + +data class AAR( + val reviewTemplateId: Int, + val initialGoal: String, + val result: String, + val difference: String, + val persistence: String, + val actionPlan: String, +) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/F5.kt b/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/F5.kt new file mode 100644 index 00000000..bbd6654e --- /dev/null +++ b/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/F5.kt @@ -0,0 +1,11 @@ +package com.puzzling.puzzlingaos.domain.entity + +data class F5( + val reviewTemplateId: Int, + val fact: String, + val feeling: String, + val finding: String, + val feedback: String, + val actionPlan: String, + +) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/TIL.kt b/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/TIL.kt new file mode 100644 index 00000000..0d4cb16e --- /dev/null +++ b/app/src/main/java/com/puzzling/puzzlingaos/domain/entity/TIL.kt @@ -0,0 +1,8 @@ +package com.puzzling.puzzlingaos.domain.entity + +data class TIL( + val reviewTemplateId: Int, + val liked: String, + val lacked: String, + val actionPlan: String, +) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt b/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt index 9964b698..3ac8c42d 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt @@ -14,6 +14,7 @@ interface WriteReviewRepository { memberId: Int, projectId: Int, requestReviewTIL: RequestReviewTILDto, +// requestReviewTIL: TIL, ): Result suspend fun upload5F( diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/HomeViewModel.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/HomeViewModel.kt index 6d87d819..bd0c7bc1 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/HomeViewModel.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/HomeViewModel.kt @@ -8,6 +8,7 @@ import androidx.lifecycle.viewModelScope import com.puzzling.puzzlingaos.data.model.response.ResponseMyPageProjectDto import com.puzzling.puzzlingaos.domain.entity.Project import com.puzzling.puzzlingaos.domain.repository.MyBoardRepository +import com.puzzling.puzzlingaos.util.UserInfo import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @@ -54,7 +55,7 @@ class HomeViewModel @Inject constructor( } private fun getProjectList() = viewModelScope.launch { - repository.getProceedingProject(1).onSuccess { response -> + repository.getProceedingProject(UserInfo.MEMBER_ID).onSuccess { response -> Log.d("home", "getProjectList() success:: $response") _projectList.value = response }.onFailure { diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardViewModel.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardViewModel.kt index abf8be18..beb36ce9 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardViewModel.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardViewModel.kt @@ -9,6 +9,7 @@ import androidx.lifecycle.viewModelScope import com.puzzling.puzzlingaos.domain.entity.ActionPlan import com.puzzling.puzzlingaos.domain.entity.MyPuzzleBoard import com.puzzling.puzzlingaos.domain.repository.MyBoardRepository +import com.puzzling.puzzlingaos.util.UserInfo import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch import javax.inject.Inject @@ -72,7 +73,7 @@ class PersonalDashboardViewModel @Inject constructor( } private fun getMyPuzzleBoard() = viewModelScope.launch { - repository.getUserPuzzleBoard(1, 3, "2023-07-05") + repository.getUserPuzzleBoard(UserInfo.MEMBER_ID, UserInfo.PROJECT_ID, "2023-07-05") .onSuccess { response -> _myPuzzleBoardList.value = response Log.d("personal", "getMyPuzzleBoard() success:: $response") @@ -92,7 +93,7 @@ class PersonalDashboardViewModel @Inject constructor( } private fun getActionPlan() = viewModelScope.launch { - repository.getActionPlan(1, 3).onSuccess { response -> + repository.getActionPlan(UserInfo.MEMBER_ID, UserInfo.PROJECT_ID).onSuccess { response -> Log.d("personal", "getActionPlan() success:: $response") _actionPlanList.value = response }.onFailure { diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/main/HomeChooseProjectFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/main/HomeChooseProjectFragment.kt index 070e86d0..079b38bc 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/main/HomeChooseProjectFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/main/HomeChooseProjectFragment.kt @@ -11,9 +11,11 @@ import com.puzzling.puzzlingaos.databinding.FragmentHomeChooseProjectBinding import com.puzzling.puzzlingaos.presentation.home.HomeViewModel import com.puzzling.puzzlingaos.presentation.invitationCode.InvitationCodeActivity import com.puzzling.puzzlingaos.presentation.register.RegisterActivity +import dagger.hilt.android.AndroidEntryPoint import kotlinx.coroutines.delay import kotlinx.coroutines.launch +@AndroidEntryPoint class HomeChooseProjectFragment : BottomSheetDialogFragment(R.layout.fragment_home_choose_project) { private val viewModel by activityViewModels() diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseReviewFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseReviewFragment.kt index 3bcfe5c7..ebca6473 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseReviewFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/ChooseReviewFragment.kt @@ -6,13 +6,16 @@ import androidx.fragment.app.activityViewModels import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BottomSheetDialogFragment import com.puzzling.puzzlingaos.databinding.FragmentChooseReviewBinding +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class ChooseReviewFragment : BottomSheetDialogFragment(R.layout.fragment_choose_review) { private val viewModel by activityViewModels() override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + binding.vm = viewModel clickItemButton() } diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/RegisterDialogFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/RegisterDialogFragment.kt index a2950655..93b112c1 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/RegisterDialogFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/RegisterDialogFragment.kt @@ -3,12 +3,17 @@ package com.puzzling.puzzlingaos.presentation.writeRetrospective import android.os.Bundle import android.util.Log import android.view.View +import androidx.fragment.app.activityViewModels import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BaseDialogFragment import com.puzzling.puzzlingaos.databinding.FragmentRegisterDialogBinding +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class RegisterDialogFragment : BaseDialogFragment(R.layout.fragment_register_dialog) { + private val viewModel by activityViewModels() + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) initDialogCancelable() @@ -22,7 +27,14 @@ class RegisterDialogFragment : private fun clickBtn() { with(binding) { btnRegisterDialogTop.setOnClickListener { - Log.d("write", "서버로 작성한 글 Post") + Log.d("dialog", "register 버튼 누름") + when (viewModel.selectedReviewType.value) { + "TIL" -> viewModel.postReviewTIL() + "5F" -> viewModel.postReview5F() + "AAR" -> viewModel.postReviewAAR() + } + // TODO detailRetroActivity 넘어갈때 + // 프로젝트 이름을 넘겨줌 } btnRegisterDialogBottom.setOnClickListener { dialog?.dismiss() diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/Write5fFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/Write5fFragment.kt index 1eec0499..d730a906 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/Write5fFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/Write5fFragment.kt @@ -1,3 +1,5 @@ +package com.puzzling.puzzlingaos.presentation.writeRetrospective + import android.os.Bundle import android.view.View import androidx.fragment.app.activityViewModels @@ -5,8 +7,9 @@ import androidx.lifecycle.MutableLiveData import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BaseFragment import com.puzzling.puzzlingaos.databinding.FragmentWrite5fBinding -import com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteReviewViewModel +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class Write5fFragment : BaseFragment(R.layout.fragment_write5f) { private val viewModel by activityViewModels() diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteAarFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteAarFragment.kt index ec04831e..e1a209cf 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteAarFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteAarFragment.kt @@ -7,7 +7,9 @@ import androidx.lifecycle.MutableLiveData import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BaseFragment import com.puzzling.puzzlingaos.databinding.FragmentWriteAarBinding +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class WriteAarFragment : BaseFragment(R.layout.fragment_write_aar) { private val viewModel by activityViewModels() diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveActivity.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveActivity.kt index 987ca23a..74ee3c0d 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveActivity.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteRetrospectiveActivity.kt @@ -1,7 +1,5 @@ package com.puzzling.puzzlingaos.presentation.writeRetrospective -import Write5fFragment -import WriteTilFragment import android.os.Bundle import android.util.Log import androidx.activity.viewModels @@ -10,10 +8,13 @@ import androidx.fragment.app.commit import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BaseActivity import com.puzzling.puzzlingaos.databinding.ActivityWriteRetrospectiveBinding +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class WriteRetrospectiveActivity : BaseActivity(R.layout.activity_write_retrospective) { private val viewModel by viewModels() + private var reviewType: String = "" override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) @@ -54,10 +55,11 @@ class WriteRetrospectiveActivity : } private fun handleSelectedReviewType() { - viewModel.selectedReviewType.observe(this) { reviewType -> - binding.tvWriteChip.text = reviewType + viewModel.selectedReviewType.observe(this) { type -> + binding.tvWriteChip.text = type + reviewType = type Log.d("write", "review type:: $reviewType") - when (reviewType) { + when (type) { "TIL" -> { clearTilQuestionText() replaceFragment(WriteTilFragment()) @@ -74,26 +76,71 @@ class WriteRetrospectiveActivity : } } + // private fun clearTilQuestionText() { +// viewModel.tilQuestion1.value = "" +// viewModel.tilQuestion2.value = "" +// viewModel.tilQuestion3.value = "" +// } +// +// private fun clear5fQuestionText() { +// viewModel.question5f1.value = "" +// viewModel.question5f2.value = "" +// viewModel.question5f3.value = "" +// viewModel.question5f4.value = "" +// viewModel.question5f5.value = "" +// } +// +// private fun clearAarQuestionText() { +// viewModel.aarQuestion1.value = "" +// viewModel.aarQuestion2.value = "" +// viewModel.aarQuestion3.value = "" +// viewModel.aarQuestion4.value = "" +// viewModel.aarQuestion5.value = "" +// } + + private fun clearText(vararg text: String?): Array { + return Array(text.size) { "" } + } + private fun clearTilQuestionText() { - viewModel.tilQuestion1.value = "" - viewModel.tilQuestion2.value = "" - viewModel.tilQuestion3.value = "" + val clearedText = clearText( + viewModel.tilQuestion1.value, + viewModel.tilQuestion2.value, + viewModel.tilQuestion3.value, + ) + viewModel.tilQuestion1.value = clearedText[0] + viewModel.tilQuestion2.value = clearedText[1] + viewModel.tilQuestion3.value = clearedText[2] } private fun clear5fQuestionText() { - viewModel.question5f1.value = "" - viewModel.question5f2.value = "" - viewModel.question5f3.value = "" - viewModel.question5f4.value = "" - viewModel.question5f5.value = "" + val clearedText = clearText( + viewModel.question5f1.value, + viewModel.question5f2.value, + viewModel.question5f3.value, + viewModel.question5f4.value, + viewModel.question5f5.value, + ) + viewModel.question5f1.value = clearedText[0] + viewModel.question5f2.value = clearedText[1] + viewModel.question5f3.value = clearedText[2] + viewModel.question5f4.value = clearedText[3] + viewModel.question5f5.value = clearedText[4] } private fun clearAarQuestionText() { - viewModel.aarQuestion1.value = "" - viewModel.aarQuestion2.value = "" - viewModel.aarQuestion3.value = "" - viewModel.aarQuestion4.value = "" - viewModel.aarQuestion5.value = "" + val clearedText = clearText( + viewModel.aarQuestion1.value, + viewModel.aarQuestion2.value, + viewModel.aarQuestion3.value, + viewModel.aarQuestion4.value, + viewModel.aarQuestion5.value, + ) + viewModel.aarQuestion1.value = clearedText[0] + viewModel.aarQuestion2.value = clearedText[1] + viewModel.aarQuestion3.value = clearedText[2] + viewModel.aarQuestion4.value = clearedText[3] + viewModel.aarQuestion5.value = clearedText[4] } private fun checkBtnEnabled() { diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt index e4eabbc6..30ed56a6 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt @@ -5,9 +5,28 @@ import androidx.lifecycle.LiveData import androidx.lifecycle.MediatorLiveData import androidx.lifecycle.MutableLiveData import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope +import com.puzzling.puzzlingaos.data.model.request.RequestReview5FDto +import com.puzzling.puzzlingaos.data.model.request.RequestReviewAARDto +import com.puzzling.puzzlingaos.data.model.request.RequestReviewTILDto +import com.puzzling.puzzlingaos.domain.entity.AAR +import com.puzzling.puzzlingaos.domain.entity.F5 +import com.puzzling.puzzlingaos.domain.entity.ReviewType +import com.puzzling.puzzlingaos.domain.entity.TIL +import com.puzzling.puzzlingaos.domain.repository.WriteReviewRepository +import com.puzzling.puzzlingaos.util.UserInfo +import dagger.hilt.android.lifecycle.HiltViewModel +import kotlinx.coroutines.launch +import javax.inject.Inject -class WriteReviewViewModel : ViewModel() { +@HiltViewModel +class WriteReviewViewModel @Inject constructor( + private val repository: WriteReviewRepository, +) : ViewModel() { private val registerRegex = WRITE_REGEX.toRegex() + private var til: TIL? = null + private var aar: AAR? = null + private var f5: F5? = null val tilQuestion1 = MutableLiveData() val tilQuestion2 = MutableLiveData() @@ -50,6 +69,22 @@ class WriteReviewViewModel : ViewModel() { val selectedChipText: LiveData get() = _selectedChipText + private var _reviewTypeList: MutableLiveData> = MutableLiveData() + val reviewTypeList: LiveData> + get() = _reviewTypeList + + private var _reviewNameList: MutableLiveData> = MutableLiveData() + val reviewNameList: LiveData> + get() = _reviewNameList + + private var _reviewDescList: MutableLiveData> = MutableLiveData() + val reviewDescList: LiveData> + get() = _reviewDescList + + private var _templateIdList: MutableLiveData> = MutableLiveData() + val templateIdList: LiveData> + get() = _templateIdList + fun setSelectedChipText(chipText: String) { _selectedChipText.value = chipText } @@ -117,12 +152,142 @@ class WriteReviewViewModel : ViewModel() { } } + init { + getReviewType() + } + fun setSelectedReviewTypeText(reviewType: String) { _selectedReviewType.value = reviewType Log.d("write", "_selectedReviewType.value :: ${_selectedReviewType.value}") + _isReviewTypeSelected.value = true } + private fun getReviewType() { + viewModelScope.launch { + repository.getReviewType().onSuccess { response -> + _reviewTypeList.value = response + val reviewTypes: List = + _reviewTypeList.value!! + Log.d("write", "getReviewType() success:: $response") + _reviewNameList.value = reviewTypes.map { + it.reviewTemplateName + } + _reviewDescList.value = reviewTypes.map { + it.reviewTemplateMeaning + } + _templateIdList.value = reviewTypes.map { + it.reviewTemplateId + } + Log.d("write", "_reviewName success:: ${_reviewNameList.value}") + Log.d("write", "_reviewDesc success:: ${_reviewDescList.value}") + }.onFailure { + Log.d("write", "getReviewType() Fail:: $it") + } + } + } + + fun getTIL(): TIL { + return TIL( + reviewTemplateId = 1, + liked = tilQuestion1.value.toString(), + lacked = tilQuestion2.value.toString(), + actionPlan = tilQuestion3.value.toString(), + ).also { + til = it + } + } + + fun get5F(): F5 { + return F5( + reviewTemplateId = 2, + fact = question5f1.value.toString(), + feeling = question5f2.value.toString(), + finding = question5f3.value.toString(), + feedback = question5f4.value.toString(), + actionPlan = question5f5.value.toString(), + ).also { + f5 = it + } + } + + fun getAAR(): AAR { + return AAR( + reviewTemplateId = 3, + initialGoal = aarQuestion1.value.toString(), + result = aarQuestion2.value.toString(), + difference = aarQuestion3.value.toString(), + persistence = aarQuestion4.value.toString(), + actionPlan = aarQuestion5.value.toString(), + ).also { + aar = it + } + } + + fun postReviewTIL() { + val requestReviewTIL = RequestReviewTILDto( + 1, + tilQuestion1.value.toString(), + tilQuestion2.value.toString(), + tilQuestion3.value.toString(), + ) + viewModelScope.launch { + repository.uploadTIL( + UserInfo.MEMBER_ID, + UserInfo.PROJECT_ID, + requestReviewTIL, + ).onSuccess { + Log.d("write", "postReviewTIL() success!!") + }.onFailure { + Log.d("write", "postReviewTIL() Fail:: $it") + } + } + } + + fun postReview5F() { + val requestReview5F = RequestReview5FDto( + 2, + question5f1.value.toString(), + question5f2.value.toString(), + question5f3.value.toString(), + question5f4.value.toString(), + question5f5.value.toString(), + ) + viewModelScope.launch { + repository.upload5F( + UserInfo.MEMBER_ID, + UserInfo.PROJECT_ID, + requestReview5F, + ).onSuccess { + Log.d("write", "postReview5F() success!!") + }.onFailure { + Log.d("write", "postReview5F() Fail:: $it") + } + } + } + + fun postReviewAAR() { + val requestReviewAAR = RequestReviewAARDto( + 3, + aarQuestion1.value.toString(), + aarQuestion2.value.toString(), + aarQuestion3.value.toString(), + aarQuestion4.value.toString(), + aarQuestion5.value.toString(), + ) + viewModelScope.launch { + repository.uploadAAR( + UserInfo.MEMBER_ID, + UserInfo.PROJECT_ID, + requestReviewAAR, + ).onSuccess { + Log.d("write", "postReviewAAR() success!!") + }.onFailure { + Log.d("write", "postReviewAAR() Fail:: $it") + } + } + } + companion object { const val WRITE_REGEX = "^[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9 \\\\\\\\s!@#\$%^&*()-_=+\\\\[{\\\\]}\\\\|;:'\",.<>/?]*\$" diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteTilFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteTilFragment.kt index 377415d6..cce482bf 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteTilFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteTilFragment.kt @@ -1,3 +1,5 @@ +package com.puzzling.puzzlingaos.presentation.writeRetrospective + import android.os.Bundle import android.view.View import androidx.fragment.app.activityViewModels @@ -5,8 +7,9 @@ import androidx.lifecycle.MutableLiveData import com.puzzling.puzzlingaos.R import com.puzzling.puzzlingaos.base.BaseFragment import com.puzzling.puzzlingaos.databinding.FragmentWriteTilBinding -import com.puzzling.puzzlingaos.presentation.writeRetrospective.WriteReviewViewModel +import dagger.hilt.android.AndroidEntryPoint +@AndroidEntryPoint class WriteTilFragment : BaseFragment(R.layout.fragment_write_til) { private val viewModel by activityViewModels() diff --git a/app/src/main/java/com/puzzling/puzzlingaos/util/Constants.kt b/app/src/main/java/com/puzzling/puzzlingaos/util/Constants.kt new file mode 100644 index 00000000..283f3300 --- /dev/null +++ b/app/src/main/java/com/puzzling/puzzlingaos/util/Constants.kt @@ -0,0 +1,6 @@ +package com.puzzling.puzzlingaos.util + +object UserInfo { + const val MEMBER_ID = 2 + const val PROJECT_ID = 138 +} diff --git a/app/src/main/res/layout/fragment_choose_review.xml b/app/src/main/res/layout/fragment_choose_review.xml index 9bd5885f..7d33577b 100644 --- a/app/src/main/res/layout/fragment_choose_review.xml +++ b/app/src/main/res/layout/fragment_choose_review.xml @@ -4,6 +4,9 @@ xmlns:tools="http://schemas.android.com/tools"> + @@ -42,7 +45,8 @@ android:layout_height="wrap_content" android:layout_marginStart="20dp" android:includeFontPadding="false" - android:text="TIL" + tools:text="TIL" + android:text="@{vm.reviewNameList[0]}" android:textAppearance="@style/Kor.Body1.Bold" app:layout_constraintBottom_toBottomOf="@+id/cl_choose_first" app:layout_constraintStart_toEndOf="@+id/cl_choose_first" @@ -56,7 +60,8 @@ android:textAppearance="@style/Kor.Detail1.Regular" android:textColor="@color/gray_600" android:includeFontPadding="false" - android:text="학습과 자기 반성을 통해 향후 더 나은 결정을\n 내릴 수 있게 해 주는 회고 방식이에요!" + android:text="@{vm.reviewDescList[0]}" + tools:text="학습과 자기 반성을 통해 향후 더 나은 결정을\n 내릴 수 있게 해 주는 회고 방식이에요!" app:layout_constraintStart_toEndOf="@+id/tv_choose_first" app:layout_constraintTop_toTopOf="@+id/tv_choose_first"/> @@ -76,7 +81,8 @@ android:layout_height="wrap_content" android:layout_marginStart="20dp" android:includeFontPadding="false" - android:text="5F" + android:text="@{vm.reviewNameList[1]}" + tools:text="5F" android:textAppearance="@style/Kor.Body1.Bold" app:layout_constraintBottom_toBottomOf="@+id/cl_choose_second" app:layout_constraintStart_toEndOf="@+id/cl_choose_second" @@ -90,7 +96,8 @@ android:textAppearance="@style/Kor.Detail1.Regular" android:textColor="@color/gray_600" android:includeFontPadding="false" - android:text="다양한 측면을 고려하여 개인과 프로젝트 전\n체적인 관점을 보여주는 회고 방식이에요!" + android:text="@{vm.reviewDescList[1]}" + tools:text="다양한 측면을 고려하여 개인과 프로젝트 전\n체적인 관점을 보여주는 회고 방식이에요!" app:layout_constraintStart_toEndOf="@+id/tv_choose_second" app:layout_constraintTop_toTopOf="@+id/tv_choose_second"/> @@ -110,7 +117,8 @@ android:layout_height="wrap_content" android:layout_marginStart="20dp" android:includeFontPadding="false" - android:text="AAR" + android:text="@{vm.reviewNameList[2]}" + tools:text="AAR" android:textAppearance="@style/Kor.Body1.Bold" app:layout_constraintBottom_toBottomOf="@+id/cl_choose_third" app:layout_constraintStart_toEndOf="@+id/cl_choose_third" @@ -125,7 +133,8 @@ android:textColor="@color/gray_600" android:layout_marginBottom="67dp" android:includeFontPadding="false" - android:text="목표 달성에 대한 책임감과 함께, 개선에 중\n점을 두는 회고 방식이에요!" + android:text="@{vm.reviewDescList[2]}" + tools:text="목표 달성에 대한 책임감과 함께, 개선에 중\n점을 두는 회고 방식이에요!" app:layout_constraintStart_toEndOf="@+id/tv_choose_third" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintTop_toTopOf="@+id/tv_choose_third"/> From de6088b91989438cdd5f1f57dc386c0eafae5a67 Mon Sep 17 00:00:00 2001 From: Cat-JiYoung Date: Wed, 19 Jul 2023 19:03:41 +0900 Subject: [PATCH 4/5] =?UTF-8?q?[FEAT]=20=EC=9D=B4=EC=A0=84=20=EC=A7=84?= =?UTF-8?q?=ED=96=89=ED=95=9C=20=ED=9A=8C=EA=B3=A0=20=EA=B8=B0=EB=B0=98=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=A0=84=ED=99=98=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/WriteReviewRepository.kt | 14 ---- .../personal/PersonalDashboardFragment.kt | 17 ++++- .../personal/PersonalDashboardViewModel.kt | 30 +++++--- .../WriteReviewViewModel.kt | 74 +++++++++++++------ .../layout/activity_write_retrospective.xml | 2 +- .../main/res/layout/fragment_write_aar.xml | 10 +-- 6 files changed, 88 insertions(+), 59 deletions(-) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt b/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt index 3ac8c42d..653615f3 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/domain/repository/WriteReviewRepository.kt @@ -14,32 +14,18 @@ interface WriteReviewRepository { memberId: Int, projectId: Int, requestReviewTIL: RequestReviewTILDto, -// requestReviewTIL: TIL, ): Result suspend fun upload5F( memberId: Int, projectId: Int, requestReview5F: RequestReview5FDto, -// reviewTemplateId: Int, -// fact: String, -// feeling: String, -// finding: String, -// feedback: String, -// actionPlan: String, ): Result suspend fun uploadAAR( memberId: Int, projectId: Int, requestReviewAAR: RequestReviewAARDto, - -// reviewTemplateId: Int, -// initialGoal: String, -// result: String, -// difference: String, -// persistence: String, -// actionPlan: String, ): Result suspend fun getPreviousTemplate( diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardFragment.kt index e2e8c64e..147c4841 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardFragment.kt @@ -41,9 +41,20 @@ class PersonalDashboardFragment : private fun clickBottomBtn() { binding.clPersonalBottomBtn.setOnClickListener { - activity?.let { - val intent = Intent(context, WriteRetrospectiveActivity::class.java) - startActivity(intent) + when (viewModel.previousReviewType.value) { + 1 -> activity?.let { // TIL + val intent = Intent(context, WriteRetrospectiveActivity::class.java) + startActivity(intent) + } + 2 -> activity?.let { // 5F + val intent = Intent(context, WriteRetrospectiveActivity::class.java) + startActivity(intent) + } + 3 -> activity?.let { + // AAR + val intent = Intent(context, WriteRetrospectiveActivity::class.java) + startActivity(intent) + } } } } diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardViewModel.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardViewModel.kt index beb36ce9..c7242ea9 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardViewModel.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/home/personal/PersonalDashboardViewModel.kt @@ -9,6 +9,7 @@ import androidx.lifecycle.viewModelScope import com.puzzling.puzzlingaos.domain.entity.ActionPlan import com.puzzling.puzzlingaos.domain.entity.MyPuzzleBoard import com.puzzling.puzzlingaos.domain.repository.MyBoardRepository +import com.puzzling.puzzlingaos.domain.repository.WriteReviewRepository import com.puzzling.puzzlingaos.util.UserInfo import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.launch @@ -17,6 +18,7 @@ import javax.inject.Inject @HiltViewModel class PersonalDashboardViewModel @Inject constructor( private val repository: MyBoardRepository, + private val writeReviewRepository: WriteReviewRepository, ) : ViewModel() { private val _myNickname = MutableLiveData() val myNickname: LiveData get() = _myNickname @@ -44,6 +46,10 @@ class PersonalDashboardViewModel @Inject constructor( val actionPlanList: LiveData> get() = _actionPlanList + private val _previousReviewType = MutableLiveData() + val previousReviewType: LiveData + get() = _previousReviewType + private val _isSuccess = MutableLiveData(false) val isSuccess: LiveData get() = _isSuccess @@ -52,6 +58,7 @@ class PersonalDashboardViewModel @Inject constructor( getMyPuzzleData() getActionPlan() getMyPuzzleBoard() + getPreviousTemplate() } private fun getMyPuzzleData() = viewModelScope.launch { @@ -101,16 +108,15 @@ class PersonalDashboardViewModel @Inject constructor( } } -// val actionPlanList: List = -// listOf( -// ActionPlan("여기에는 글이 계속 작성되다가 작성되다가 작성되다가 작성되다가 이쯤 되면 끊기게 돼...", "7월 3일"), -// ActionPlan("여기에는 글이 계속 작성되다가 작성되다가 작성되다가 작성되다가 이쯤 되면 끊기게 돼...", "7월 4일"), -// ActionPlan("여기에는 글이 계속 작성되다가 작성되다가 작성되다가 작성되다가 이쯤 되면 끊기게 돼...", "7월 5일"), -// ActionPlan("여기에는 글이 계속 작성되다가 작성되다가 작성되다가 작성되다가 이쯤 되면 끊기게 돼...", "7월 6일"), -// ActionPlan("여기에는 글이 계속 작성되다가 작성되다가 작성되다가 작성되다가 이쯤 되면 끊기게 돼...", "7월 7일"), -// ) - - val _bottomButtonText = MutableLiveData() - val bottomButtonText: String - get() = _bottomButtonText.value ?: "회고 작성일이 아니에요" + private fun getPreviousTemplate() { + viewModelScope.launch { + writeReviewRepository.getPreviousTemplate(UserInfo.MEMBER_ID, UserInfo.PROJECT_ID) + .onSuccess { response -> + _previousReviewType.value = response.data.previousTemplateId + Log.d("write", "getPreviousTemplate() success:: ${_previousReviewType.value}") + }.onFailure { + Log.d("write", "getPreviousTemplate() Fail:: $it") + } + } + } } diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt index 30ed56a6..62a4cfd6 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/WriteReviewViewModel.kt @@ -65,6 +65,10 @@ class WriteReviewViewModel @Inject constructor( val selectedReviewType: LiveData get() = _selectedReviewType + private val _reviewTypeText = MutableLiveData() + val reviewTypeText: LiveData + get() = _reviewTypeText + private val _selectedChipText = MutableLiveData() val selectedChipText: LiveData get() = _selectedChipText @@ -85,6 +89,10 @@ class WriteReviewViewModel @Inject constructor( val templateIdList: LiveData> get() = _templateIdList + private val _previousReviewType = MutableLiveData() + val previousReviewType: LiveData + get() = _previousReviewType + fun setSelectedChipText(chipText: String) { _selectedChipText.value = chipText } @@ -154,6 +162,7 @@ class WriteReviewViewModel @Inject constructor( init { getReviewType() + getPreviousTemplate() } fun setSelectedReviewTypeText(reviewType: String) { @@ -163,30 +172,6 @@ class WriteReviewViewModel @Inject constructor( _isReviewTypeSelected.value = true } - private fun getReviewType() { - viewModelScope.launch { - repository.getReviewType().onSuccess { response -> - _reviewTypeList.value = response - val reviewTypes: List = - _reviewTypeList.value!! - Log.d("write", "getReviewType() success:: $response") - _reviewNameList.value = reviewTypes.map { - it.reviewTemplateName - } - _reviewDescList.value = reviewTypes.map { - it.reviewTemplateMeaning - } - _templateIdList.value = reviewTypes.map { - it.reviewTemplateId - } - Log.d("write", "_reviewName success:: ${_reviewNameList.value}") - Log.d("write", "_reviewDesc success:: ${_reviewDescList.value}") - }.onFailure { - Log.d("write", "getReviewType() Fail:: $it") - } - } - } - fun getTIL(): TIL { return TIL( reviewTemplateId = 1, @@ -288,6 +273,47 @@ class WriteReviewViewModel @Inject constructor( } } + private fun getReviewType() { + viewModelScope.launch { + repository.getReviewType().onSuccess { response -> + _reviewTypeList.value = response + val reviewTypes: List = + _reviewTypeList.value!! + Log.d("write", "getReviewType() success:: $response") + _reviewNameList.value = reviewTypes.map { + it.reviewTemplateName + } + _reviewDescList.value = reviewTypes.map { + it.reviewTemplateMeaning + } + _templateIdList.value = reviewTypes.map { + it.reviewTemplateId + } + Log.d("write", "_reviewName success:: ${_reviewNameList.value}") + Log.d("write", "_reviewDesc success:: ${_reviewDescList.value}") + }.onFailure { + Log.d("write", "getReviewType() Fail:: $it") + } + } + } + + private fun getPreviousTemplate() { + viewModelScope.launch { + repository.getPreviousTemplate(UserInfo.MEMBER_ID, UserInfo.PROJECT_ID) + .onSuccess { response -> + _previousReviewType.value = response.data.previousTemplateId + when (_previousReviewType.value) { + 1 -> _reviewTypeText.value = "TIL" + 2 -> _reviewTypeText.value = "5F" + 3 -> _reviewTypeText.value = "AAR" + } + Log.d("write", "getPreviousTemplate() success:: ${_previousReviewType.value}") + }.onFailure { + Log.d("write", "getPreviousTemplate() Fail:: $it") + } + } + } + companion object { const val WRITE_REGEX = "^[ㄱ-ㅎㅏ-ㅣ가-힣a-zA-Z0-9 \\\\\\\\s!@#\$%^&*()-_=+\\\\[{\\\\]}\\\\|;:'\",.<>/?]*\$" diff --git a/app/src/main/res/layout/activity_write_retrospective.xml b/app/src/main/res/layout/activity_write_retrospective.xml index 89828981..f936e071 100644 --- a/app/src/main/res/layout/activity_write_retrospective.xml +++ b/app/src/main/res/layout/activity_write_retrospective.xml @@ -113,7 +113,7 @@ android:layout_marginStart="18dp" android:layout_marginEnd="2dp" android:includeFontPadding="false" - android:text="@string/tv_write_chip" + android:text="@{vm.reviewTypeText}" android:textAppearance="@style/Kor.Body1.Bold" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintHorizontal_bias="0" diff --git a/app/src/main/res/layout/fragment_write_aar.xml b/app/src/main/res/layout/fragment_write_aar.xml index d38c0340..d6bbf86b 100644 --- a/app/src/main/res/layout/fragment_write_aar.xml +++ b/app/src/main/res/layout/fragment_write_aar.xml @@ -64,7 +64,7 @@ android:hint="placeholder 위치, 텍스트박스는 기본 사이즈입니다. 양 옆 마진 16px을 가진 텍스트박스가 존재합니다. " android:scrollbars="vertical" android:selectAllOnFocus="false" - android:text="@={vm.question5f1}" /> + android:text="@={vm.aarQuestion1}" /> @@ -117,7 +117,7 @@ android:hint="placeholder 위치, 텍스트박스는 기본 사이즈입니다. 양 옆 마진 16px을 가진 텍스트박스가 존재합니다. " android:scrollbars="vertical" android:selectAllOnFocus="false" - android:text="@={vm.question5f2}" /> + android:text="@={vm.aarQuestion2}" /> + android:text="@={vm.aarQuestion3}" /> + android:text="@={vm.aarQuestion4}" /> + android:text="@={vm.aarQuestion5}" /> From 5d408cf4b240b4a5207f518b10ad3a02dc5f0481 Mon Sep 17 00:00:00 2001 From: Cat-JiYoung Date: Wed, 19 Jul 2023 19:16:24 +0900 Subject: [PATCH 5/5] =?UTF-8?q?[FEAT]=20postSaveReviewAAR=20service=20path?= =?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 --- .../puzzling/puzzlingaos/data/service/WriteReviewService.kt | 2 +- .../presentation/writeRetrospective/RegisterDialogFragment.kt | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/puzzling/puzzlingaos/data/service/WriteReviewService.kt b/app/src/main/java/com/puzzling/puzzlingaos/data/service/WriteReviewService.kt index 6d504016..76382d33 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/data/service/WriteReviewService.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/data/service/WriteReviewService.kt @@ -45,7 +45,7 @@ interface WriteReviewService { [회고 글 작성 API(ARR)] ~/api/v1/member/{memberId}/project/{projectId}/review/ARR */ - @POST("api/v1/member/{memberId}/project/{projectId}/review/ARR") + @POST("api/v1/member/{memberId}/project/{projectId}/review/AAR") suspend fun postSaveReviewAAR( @Path("memberId") memberId: Int, @Path("projectId") projectId: Int, diff --git a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/RegisterDialogFragment.kt b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/RegisterDialogFragment.kt index 93b112c1..55299598 100644 --- a/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/RegisterDialogFragment.kt +++ b/app/src/main/java/com/puzzling/puzzlingaos/presentation/writeRetrospective/RegisterDialogFragment.kt @@ -33,8 +33,7 @@ class RegisterDialogFragment : "5F" -> viewModel.postReview5F() "AAR" -> viewModel.postReviewAAR() } - // TODO detailRetroActivity 넘어갈때 - // 프로젝트 이름을 넘겨줌 + // TODO detailRetroActivity 넘어갈때 프로젝트 이름을 넘겨줌 } btnRegisterDialogBottom.setOnClickListener { dialog?.dismiss()