Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
♻️ :: pr 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
chlgkdms committed Nov 30, 2023
1 parent 5003b54 commit 27ffbb3
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 37 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import com.google.gson.annotations.SerializedName
import com.signal.domain.entity.CoinsEntity

data class FetchCoinsResponse(
@SerializedName("coin_list") val coins: List<Coins>
@SerializedName("coin_list") val coins: List<Coin>
) {
data class Coins(
data class Coin(
@SerializedName("coin") val coin: Long,
@SerializedName("activity") val activity: String,
@SerializedName("create_date") val createDate: String,
Expand All @@ -15,7 +15,7 @@ data class FetchCoinsResponse(

fun FetchCoinsResponse.toEntity() = CoinsEntity(coinsEntity = this.coins.map { it.toEntity() })

private fun FetchCoinsResponse.Coins.toEntity() = CoinsEntity.CoinEntity(
private fun FetchCoinsResponse.Coin.toEntity() = CoinsEntity.CoinEntity(
coin = coin,
activity = activity,
createDate = createDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ fun FetchUserInformationResponse.toEntity() = UserInformationEntity(
birth = this.birth,
imageUrl = this.profile,
coinCount = this.coinCount,

)
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ fun UserInformationEntity.toModel() = UserInformationModel(
phone = this.phone,
birth = this.birth,
profile = this.imageUrl,
coinCount = this.coinCount
coinCount = this.coinCount,
)
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ package com.signal.data.repository
import com.signal.data.datasource.coin.CoinDataSource
import com.signal.data.model.coin.CreateCoinRequest
import com.signal.data.model.coin.toEntity
import com.signal.domain.entity.CoinsEntity
import com.signal.domain.entity.CreateCoinEntity
import com.signal.domain.enums.Coin
import com.signal.domain.repository.CoinRepository

class CoinRepositoryImpl(
private val coinDataSource: CoinDataSource,
) : CoinRepository {

override suspend fun createCoin(coin: Long, type: Coin): CreateCoinEntity =
coinDataSource.createCoin(
CreateCoinRequest(
coin = coin,
type = type,
)
).toEntity()
override suspend fun createCoin(
coin: Long,
type: Coin,
) = coinDataSource.createCoin(
CreateCoinRequest(
coin = coin,
type = type,
)
).toEntity()

override suspend fun fetchCoin(): CoinsEntity = coinDataSource.fetchCoins().toEntity()
override suspend fun fetchCoin() = coinDataSource.fetchCoins().toEntity()
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ private fun Achievement(
Spacer(modifier = Modifier.width(10.dp))
Image(
painter = painterResource(id = R.drawable.ic_coin),
contentDescription = stringResource(
id = R.string.achievement_image
),
contentDescription = stringResource(id = R.string.achievement_image),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ internal fun CoinDialog(
Image(
modifier = Modifier.size(70.dp),
painter = painterResource(id = R.drawable.ic_coin),
contentDescription = stringResource(
id = R.string.coin_image
),
contentDescription = stringResource(id = R.string.coin_image),
)
Spacer(modifier = Modifier.height(30.dp))
SubTitle(
text = when (coin) {
COMMENT -> stringResource(id = R.string.get_1_coin)
FEED -> stringResource(id = R.string.get_2_coin)
DIARY -> stringResource(id = R.string.get_3_coin)
RESERVATION -> stringResource(id = R.string.get_4_coin)
}
text = stringResource(
id = when (coin) {
COMMENT -> R.string.get_1_coin
FEED -> R.string.get_2_coin
DIARY -> R.string.get_3_coin
RESERVATION -> R.string.get_4_coin
}
),
)
Spacer(modifier = Modifier.height(6.dp))
Body(text = "현재 보유 코인 : $coinCount")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ internal fun CoinHistory(
title = stringResource(id = R.string.coin_history),
onLeadingClicked = { moveToBack() },
)
Row(modifier = Modifier.fillMaxSize()) {
Coins(
coins = state.coins,
)
}
Coins(coins = state.coins)
}
Spacer(modifier = Modifier.height(12.dp))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,7 @@ private fun Achievement(
Image(
modifier = Modifier.size(60.dp),
painter = painterResource(id = R.drawable.ic_coin_1k),
contentDescription = stringResource(
id = R.string.achievement_image
),
contentDescription = stringResource(id = R.string.achievement_image),
)
}
}
Expand Down Expand Up @@ -372,10 +370,10 @@ private fun CardUserTool(
.fillMaxWidth()
.height(60.dp)
.shadow(
elevation = 2.dp, shape = RoundedCornerShape(8.dp)
elevation = 2.dp,
shape = RoundedCornerShape(8.dp),
)
.clip(RoundedCornerShape(8.dp))

.background(color = SignalColor.White)
.signalClickable(
rippleEnabled = true,
Expand Down

0 comments on commit 27ffbb3

Please sign in to comment.