Skip to content

Commit

Permalink
refactor: 코틀린 컨벤션에 맞춰 코드 정리
Browse files Browse the repository at this point in the history
  • Loading branch information
iiolo committed Jan 19, 2024
1 parent d646bcd commit 732e08f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SupplementRepository

suspend fun getSupplementDetail(
accessToken: String?,
supplementsId: Int
supplementsId: Int,
): Result<DetailSupplement> =
kotlin.runCatching {
val response =
Expand All @@ -57,7 +57,7 @@ class SupplementRepository

suspend fun getSupplementDogs(
accessToken: String?,
dogId: Long?
dogId: Long?,
): Result<DogSupplement> =
kotlin.runCatching {
val response = supplementAPI.getSupplementDogs(accessToken, dogId)
Expand All @@ -71,7 +71,7 @@ class SupplementRepository

suspend fun checkSupplement(
accessToken: String?,
supplementsRecordId: Int
supplementsRecordId: Int,
): Result<ResponseBody> =
kotlin.runCatching {
val response =
Expand Down Expand Up @@ -137,7 +137,7 @@ class SupplementRepository

suspend fun deleteSupplementsById(
accessToken: String?,
supplementsIds: IntArray
supplementsIds: IntArray,
): Int {
val response =
supplementAPI.deleteSupplementsById(
Expand All @@ -151,7 +151,7 @@ class SupplementRepository

suspend fun deleteSupplementById(
accessToken: String?,
supplementsId: Int
supplementsId: Int,
): Int {
val response =
supplementAPI.deleteSupplementById(
Expand All @@ -163,7 +163,7 @@ class SupplementRepository

suspend fun addSupplement(
accessToken: String?,
requestSupplement: RequestSupplement
requestSupplement: RequestSupplement,
): Int {
val response =
supplementAPI.addSupplement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ class SupplementViewModel
supplementAddImg.value = null
}

fun getSupplements(
date: Date,
) {
fun getSupplements(date: Date) {
viewModelScope.launch {
val covertedDate = convertToDateToDate(date)
val accessToken: String? =
Expand Down Expand Up @@ -167,9 +165,9 @@ class SupplementViewModel
dto,
file,
)
Log.d("영양제 추가 확인",supplementDto.toString())
Log.d("영양제 추가 확인", supplementDto.toString())
supplementCode.value = repository.addSupplement(accessToken, requestSupplement)
Log.d("영양제 추가 확인2",supplementCode.value.toString())
Log.d("영양제 추가 확인2", supplementCode.value.toString())
}
}

Expand Down

0 comments on commit 732e08f

Please sign in to comment.