Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into chore/#177-home-pa…
Browse files Browse the repository at this point in the history
…ckaging
  • Loading branch information
Hyobeen-Park committed Aug 21, 2024
2 parents 78f8154 + 74b7f0f commit 18c1bd8
Show file tree
Hide file tree
Showing 53 changed files with 338 additions and 250 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,4 @@ fun MyPageLogoutBottomSheet(
onDismissRequest = { onDismiss() },
sheetState = sheetState
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import com.terning.core.R
import com.terning.core.designsystem.component.button.DeleteRoundButton
import com.terning.core.designsystem.component.button.RoundButton
import com.terning.core.designsystem.theme.TerningTheme
import kotlinx.coroutines.launch

@OptIn(ExperimentalMaterial3Api::class)
@Composable
Expand Down Expand Up @@ -63,7 +64,12 @@ fun MyPageQuitBottomSheet(
cornerRadius = 10.dp,
text = R.string.my_page_back_button,
onButtonClick = {
onDismiss()
scope.launch { sheetState.hide() }
.invokeOnCompletion {
if (!sheetState.isVisible) {
onDismiss()
}
}
},
modifier = modifier.padding(
start = 24.dp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ fun SignUpBottomSheet(
)
}

/**
* 6개의 프로필 이미지 중, 하나의 이미지만 선택할 수 있는 라디오 버튼입니다.
*
* @param modifier 라디오 버튼에 적용할 Modifier입니다.
* @param onOptionSelected 선택된 이미지의 인덱스 값을 나타내는 콜백 함수입니다.
* @param initialSelectedOption 초기에 선택된 이미지를 나타내는 인덱스 값입니다.
*/
@Composable
fun RadioButtonGroup(
modifier: Modifier = Modifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.SheetState
import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import com.terning.core.designsystem.theme.White

@OptIn(ExperimentalMaterial3Api::class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package com.terning.data.datasource

import com.terning.data.dto.BaseResponse
import com.terning.data.dto.response.TokenReissueResponseDto
import com.terning.domain.entity.response.TokenReissueResponseModel

interface TokenReissueDataSource {
suspend fun postReissueToken(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.terning.data.dto.request

import com.terning.domain.entity.request.FilteringRequestModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -14,12 +13,4 @@ data class FilteringRequestDto(
val startYear: Int,
@SerialName("startMonth")
val startMonth: Int
)

fun FilteringRequestModel.toFilteringRequestDto(): FilteringRequestDto =
FilteringRequestDto(
grade = grade,
workingPeriod = workingPeriod,
startYear = startYear,
startMonth = startMonth
)
)
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package com.terning.data.dto.request

import com.terning.domain.entity.request.SignInRequestModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class SignInRequestDto(
@SerialName("authType")
val authType: String
)

fun SignInRequestModel.toSignInRequestDto(): SignInRequestDto =
SignInRequestDto(authType = authType)
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.terning.data.dto.request

import com.terning.domain.entity.request.SignUpRequestModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -12,11 +11,4 @@ data class SignUpRequestDto(
val profileImage: Int,
@SerialName("authType")
val authType: String
)

fun SignUpRequestModel.toSignUpRequestDto(): SignUpRequestDto =
SignUpRequestDto(
name = name,
profileImage = profileImage,
authType = authType
)
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.terning.data.dto.response

import com.terning.domain.entity.response.MyPageProfileModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -10,6 +9,4 @@ data class MyPageResponseDto(
val name: String,
@SerialName("authType")
val authType: String
)

fun MyPageResponseDto.toMyPageProfileModel() = MyPageProfileModel(name = name, authType = authType)
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.terning.data.dto.response

import com.terning.domain.entity.response.SignInResponseModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -16,12 +15,4 @@ data class SignInResponseDto(
val authId: String,
@SerialName("authType")
val authType: String,
) {
fun toSignInModel() = SignInResponseModel(
accessToken = accessToken,
refreshToken = refreshToken,
userId = userId,
authId = authId,
authType = authType
)
}
)
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.terning.data.dto.response

import com.terning.domain.entity.response.SignUpResponseModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

Expand All @@ -14,11 +13,4 @@ data class SignUpResponseDto(
val userId: Long,
@SerialName("authType")
val authType: String,
) {
fun toSignUpModel() = SignUpResponseModel(
accessToken = accessToken,
refreshToken = refreshToken,
userId = userId,
authType = authType
)
}
)
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package com.terning.data.dto.response

import com.terning.domain.entity.response.TokenReissueResponseModel
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class TokenReissueResponseDto(
@SerialName("refreshToken")
val refreshToken: String
) {
fun toTokenReissueResponseModel() = TokenReissueResponseModel(refreshToken = refreshToken)
}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.terning.data.mapper.auth

import com.terning.data.dto.response.TokenReissueResponseDto
import com.terning.domain.entity.auth.TokenReissue

fun TokenReissueResponseDto.toTokenReissue(): TokenReissue =
TokenReissue(refreshToken = refreshToken)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.terning.data.mapper.filtering

import com.terning.data.dto.request.FilteringRequestDto
import com.terning.domain.entity.filtering.Filtering

fun Filtering.toFilteringRequestDto(): FilteringRequestDto =
FilteringRequestDto(
grade = grade,
workingPeriod = workingPeriod,
startYear = startYear,
startMonth = startMonth
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.terning.data.mapper.mypage

import com.terning.data.dto.response.MyPageResponseDto
import com.terning.domain.entity.mypage.MyPageProfileModel

fun MyPageResponseDto.toMyPageProfile() = MyPageProfileModel(name = name, authType = authType)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.terning.data.mapper.onboarding

import com.terning.data.dto.request.SignInRequestDto
import com.terning.domain.entity.onboarding.SignInRequest

fun SignInRequest.toSignInRequestDto(): SignInRequestDto =
SignInRequestDto(authType = authType)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.terning.data.mapper.onboarding

import com.terning.data.dto.response.SignInResponseDto
import com.terning.domain.entity.onboarding.SignInResponse

fun SignInResponseDto.toSignInResponse(): SignInResponse =
SignInResponse(
accessToken = accessToken,
refreshToken = refreshToken,
userId = userId,
authId = authId,
authType = authType
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package com.terning.data.mapper.onboarding

import com.terning.data.dto.request.SignUpRequestDto
import com.terning.domain.entity.onboarding.SignUpRequest

fun SignUpRequest.toSignUpRequestDto(): SignUpRequestDto =
SignUpRequestDto(
name = name,
profileImage = profileImage,
authType = authType
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.terning.data.mapper.onboarding

import com.terning.data.dto.response.SignUpResponseDto
import com.terning.domain.entity.onboarding.SignUpResponse

fun SignUpResponseDto.toSignUpResponse(): SignUpResponse =
SignUpResponse(
accessToken = accessToken,
refreshToken = refreshToken,
userId = userId,
authType = authType
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.terning.data.repositoryimpl

import com.terning.data.datasource.AuthDataSource
import com.terning.data.dto.request.toSignInRequestDto
import com.terning.data.dto.request.toSignUpRequestDto
import com.terning.domain.entity.request.SignInRequestModel
import com.terning.domain.entity.request.SignUpRequestModel
import com.terning.domain.entity.response.SignInResponseModel
import com.terning.domain.entity.response.SignUpResponseModel
import com.terning.data.mapper.onboarding.toSignInRequestDto
import com.terning.data.mapper.onboarding.toSignInResponse
import com.terning.data.mapper.onboarding.toSignUpRequestDto
import com.terning.data.mapper.onboarding.toSignUpResponse
import com.terning.domain.entity.onboarding.SignInRequest
import com.terning.domain.entity.onboarding.SignInResponse
import com.terning.domain.entity.onboarding.SignUpRequest
import com.terning.domain.entity.onboarding.SignUpResponse
import com.terning.domain.repository.AuthRepository
import javax.inject.Inject

Expand All @@ -16,21 +18,21 @@ class AuthRepositoryImpl @Inject constructor(

override suspend fun postSignIn(
authorization: String,
request: SignInRequestModel
): Result<SignInResponseModel> = runCatching {
request: SignInRequest
): Result<SignInResponse> = runCatching {
authDataSource.postSignIn(
authorization,
request.toSignInRequestDto()
).result.toSignInModel()
).result.toSignInResponse()
}

override suspend fun postSignUp(
authId: String,
request: SignUpRequestModel
): Result<SignUpResponseModel> = runCatching {
request: SignUpRequest
): Result<SignUpResponse> = runCatching {
authDataSource.postSignUp(
authId,
request.toSignUpRequestDto()
).result.toSignUpModel()
).result.toSignUpResponse()
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.terning.data.repositoryimpl

import com.terning.data.datasource.FilteringDataSource
import com.terning.data.dto.request.toFilteringRequestDto
import com.terning.domain.entity.request.FilteringRequestModel
import com.terning.data.mapper.filtering.toFilteringRequestDto
import com.terning.domain.entity.filtering.Filtering
import com.terning.domain.repository.FilteringRepository
import javax.inject.Inject

Expand All @@ -11,7 +11,7 @@ class FilteringRepositoryImpl @Inject constructor(
) : FilteringRepository {
override suspend fun postFiltering(
userId: Long,
request: FilteringRequestModel
request: Filtering
): Result<Unit> =
runCatching {
filteringDataSource.postFiltering(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package com.terning.data.repositoryimpl

import com.terning.data.datasource.MyPageDataSource
import com.terning.data.dto.response.toMyPageProfileModel
import com.terning.domain.entity.response.MyPageProfileModel
import com.terning.data.mapper.mypage.toMyPageProfile
import com.terning.domain.entity.mypage.MyPageProfileModel
import com.terning.domain.repository.MyPageRepository
import javax.inject.Inject

Expand All @@ -21,6 +21,6 @@ class MyPageRepositoryImpl @Inject constructor(

override suspend fun getProfile(): Result<MyPageProfileModel> =
runCatching {
myPageDataSource.getProfile().result.toMyPageProfileModel()
myPageDataSource.getProfile().result.toMyPageProfile()
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package com.terning.data.repositoryimpl

import com.terning.data.datasource.TokenReissueDataSource
import com.terning.domain.entity.response.TokenReissueResponseModel
import com.terning.data.mapper.auth.toTokenReissue
import com.terning.domain.entity.auth.TokenReissue
import com.terning.domain.repository.TokenReissueRepository
import javax.inject.Inject

Expand All @@ -10,10 +11,10 @@ class TokenReissueRepositoryImpl @Inject constructor(
) : TokenReissueRepository {
override suspend fun postReissueToken(
authorization: String
): Result<TokenReissueResponseModel> =
): Result<TokenReissue> =
runCatching {
tokenReissueDataSource.postReissueToken(
authorization = authorization
).result.toTokenReissueResponseModel()
).result.toTokenReissue()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.terning.domain.entity.auth

data class TokenReissue (
val refreshToken : String
)
Loading

0 comments on commit 18c1bd8

Please sign in to comment.