Skip to content

Commit

Permalink
Merge pull request #91 from AdultOfNineteen/feature/issue-90
Browse files Browse the repository at this point in the history
[FEAT] 11월 배포
  • Loading branch information
DongChyeon authored Nov 7, 2024
2 parents 4095f88 + 45e8921 commit 82d26dc
Show file tree
Hide file tree
Showing 18 changed files with 401 additions and 148 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,49 @@
package com.teamwiney.core.common.model

enum class WineSmell(val type: String, val value: String, val korName: String) {
FRUIT("FRUIT", "FRUIT", "과일향"),
BERRY("FRUIT", "BERRY", "베리류"),
LEMONANDLIME("FRUIT", "LEMONANDLIME", "레몬/라임"),
APPLEPEAR("FRUIT", "APPLEPEAR", "사과/배"),
PEACHPLUM("FRUIT", "PEACHPLUM", "복숭아/자두"),
TROPICALFRUIT("FRUIT", "TROPICALFRUIT", "열대과일"),
FLOWER("NATURAL", "FLOWER", "꽃향"),
GRASSWOOD("NATURAL", "GRASSWOOD", "풀/나무"),
HERB("NATURAL", "HERB", "허브향"),
OAK("OAK", "OAK", "오크향"),
SPICE("OAK", "SPICE", "향신료"),
NUTS("OAK", "NUTS", "견과류"),
VANILLA("OAK", "VANILLA", "바닐라"),
CHOCOLATE("OAK", "CHOCOLATE", "초콜릿"),
FLINT("OTHER", "FLINT", "부싯돌"),
BREAD("OTHER", "BREAD", ""),
RUBBER("OTHER", "RUBBER", "고무"),
EARTASH("OTHER", "EARTHASH", "흙/재"),
MEDICINE("OTHER", "MEDICINE", "약품")
FRUIT("FRUIT","FRUIT","과일향"),
BERRY("FRUIT","BERRY", "베리류"),
LEMON("FRUIT","LEMON","레몬"),
LIME("FRUIT","LIME","라임"),
APPLE("FRUIT","APPLE","사과"),
PEAR("FRUIT","PEAR",""),
PEACH("FRUIT","PEACH","복숭아"),
PLUM("FRUIT","PLUM","자두"),
TROPICALFRUIT("FRUIT","TROPICALFRUIT","열대과일"),
FLOWER("NATURAL", "FLOWER","꽃향"),
ACACIA("NATURAL", "ACACIA", "아카시아"),
ROSE("NATURAL", "ROSE", "장미"),
LAVENDER("NATURAL", "LAVENDER", "라벤더"),
GRASSWOOD("NATURAL", "GRASSWOOD","풀/나무"),
PINE("NATURAL", "PINE", "솔향"),
PEPPER("NATURAL", "PEPPER", "피망"),
ONION("NATURAL", "ONION", "양파"),
CORN("NATURAL", "CORN", "옥수수"),
HERB("NATURAL","HERB","허브향"),
MUSHROOM("NATURAL", "MUSHROOM", "버섯"),
MOSS("NATURAL", "MOSS", "이끼"),
OAK("OAK","OAK","오크향"),
SPICE("OAK","SPICE","향신료"),
PEPPERSPICE("OAK","PEPPERSPICE","후추"),
CINNAMON("OAK", "CINNAMON", "계피"),
NUTS("OAK","NUTS","견과류"),
VANILLA("OAK","VANILLA","바닐라"),
CARAMEL("OAK", "CARAMEL", "캐러멜"),
CHOCOLATE("OAK","CHOCOLATE","초콜릿"),
TOAST("OAK", "TOAST", "토스트"),
COFFEE("OAK", "COFFEE", "커피"),
COCONUT("OAK", "COCONUT", "코코넛"),
SMOKE("OAK", "SMOKE", "연기"),
FLINT("OTHER","FLINT","부싯돌"),
BREAD("OTHER", "BREAD",""),
RUBBER("OTHER","RUBBER","고무"),
SWEAT("OTHER", "SWEAT", ""),
LEATHER("OTHER", "LEATHER", "가죽"),
VINEGAR("OTHER", "VINEGAR", "식초"),
REMOVER("OTHER", "REMOVER", "리무버"),
CIGARETTE("OTHER", "CIGARETTE", "담배"),
HONEY("OTHER", "HONEY", ""),
BUTTER("OTHER", "BUTTER", "버터"),
MEDICINE("OTHER", "MEDICINE","약품"),
EARTHASH("OTHER","EARTHASH","흙/재")
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ data class TastingNote(
val userNickname: String,
@SerializedName("noteDate")
val noteDate: String,
@SerializedName("thumbnail")
val thumbnail: String?,
@SerializedName("public")
val public: Boolean
)
Expand All @@ -39,6 +41,7 @@ fun TastingNote.toDomain() = TastingNote(
public = this.public,
userNickname = this.userNickname,
noteDate = this.noteDate,
thumbnail = this.thumbnail,
varietal = this.varietal
)

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ data class TastingNoteDetail(
val officialAlcohol: Double?,
val price: Int?,
val smellKeywordList: List<String>,
val directKeywordList: List<String>,
val myWineTaste: MyWineTaste,
val defaultWineTaste: WineTaste,
val tastingNoteImage: List<TastingNoteImage>,
Expand All @@ -45,6 +46,7 @@ data class TastingNoteDetail(
officialAlcohol = null,
price = 0,
smellKeywordList = listOf("-"),
directKeywordList = emptyList(),
myWineTaste = MyWineTaste(
sweetness = 0,
acidity = 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ interface TastingNoteRepository {
buyAgain: Boolean?,
isPublic: Boolean?,
smellKeywordList: List<String>,
directSmellKeywordList: List<String>,
imgUris: List<Uri>
): Flow<ApiResult<CommonResponse<TastingNoteIdRes>>>

Expand All @@ -93,6 +94,8 @@ interface TastingNoteRepository {
isPublic: Boolean?,
smellKeywordList: List<String>,
deleteSmellKeywordList: List<String>,
directSmellKeywordList: List<String>,
deleteDirectSmellKeywordList: List<String>,
deleteImgList: List<String>,
imgUris: List<Uri>
): Flow<ApiResult<CommonResponse<TastingNoteIdRes>>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ class TastingNoteRepositoryImpl @Inject constructor(
buyAgain: Boolean?,
isPublic: Boolean?,
smellKeywordList: List<String>,
directSmellKeywordList: List<String>,
imgUris: List<Uri>
): Flow<ApiResult<CommonResponse<TastingNoteIdRes>>> {
val jsonObjectBuilder = JSONObject().apply {
Expand All @@ -110,6 +111,7 @@ class TastingNoteRepositoryImpl @Inject constructor(
buyAgain?.let { put("buyAgain", it) }
isPublic?.let { put("isPublic", it) }
put("smellKeywordList", JSONArray().apply { smellKeywordList.forEach { put(it) } })
put("directKeywordList", JSONArray().apply { directSmellKeywordList.forEach { put(it) } })
}

val request = jsonObjectBuilder.toString().toRequestBody("application/json".toMediaType())
Expand Down Expand Up @@ -146,6 +148,8 @@ class TastingNoteRepositoryImpl @Inject constructor(
isPublic: Boolean?,
smellKeywordList: List<String>,
deleteSmellKeywordList: List<String>,
directSmellKeywordList: List<String>,
deleteDirectSmellKeywordList: List<String>,
deleteImgList: List<String>,
imgUris: List<Uri>
): Flow<ApiResult<CommonResponse<TastingNoteIdRes>>> {
Expand All @@ -167,6 +171,8 @@ class TastingNoteRepositoryImpl @Inject constructor(
isPublic?.let { put("isPublic", it) }
put("smellKeywordList", JSONArray().apply { smellKeywordList.forEach { put(it) } })
put("deleteSmellKeywordList", JSONArray().apply { deleteSmellKeywordList.forEach { put(it) }})
put("directKeywordList", JSONArray().apply { directSmellKeywordList.forEach { put(it) } })
put("deleteDirectKeywordList", JSONArray().apply { deleteDirectSmellKeywordList.forEach { put(it) }})
put("deleteImgList", JSONArray().apply { deleteImgList.forEach { put(it) } })
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ fun NoteScreen(
name = it.name,
origin = it.country,
starRating = it.starRating,
thumbnail = it.thumbnail,
onClick = {
val isShared = false
appState.navigate("${NoteDestinations.NOTE_DETAIL}?id=${it.id}&isShared=$isShared")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.FilterQuality
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.buildAnnotatedString
Expand All @@ -37,6 +39,8 @@ import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.teamwiney.core.common.model.WineType
import com.teamwiney.core.common.model.WineType.Companion.convertToNoteType
import com.teamwiney.core.design.R
Expand Down Expand Up @@ -79,8 +83,11 @@ fun NoteWineCard(
name: String,
origin: String,
starRating: Int? = null,
thumbnail: String? = null,
onClick: () -> Unit,
) {
val context = LocalContext.current

val (wineName, image, borderColor, gradientCircleColor, circleColor, cardColor) = when (color) {
WineType.RED.type -> CardProperties(
color,
Expand Down Expand Up @@ -163,12 +170,33 @@ fun NoteWineCard(
)
.background(WineyTheme.colors.background_1)
) {
NoteCardSurface(
modifier = Modifier.fillMaxSize(),
gradientCircleColor = gradientCircleColor,
cardBackgroundAlpha = cardBackgroundAlpha,
circleColor = circleColor
)
if (thumbnail != null) {
Box {
AsyncImage(
model = ImageRequest.Builder(context)
.data(thumbnail)
.build(),
contentDescription = "NOTE_IMG_URL",
filterQuality = FilterQuality.Low,
contentScale = ContentScale.Crop,
)

Box(
modifier = Modifier.background(
color = WineyTheme.colors.gray_900.copy(
alpha = 0.2f
),
).matchParentSize()
)
}
} else {
NoteCardSurface(
modifier = Modifier.fillMaxSize(),
gradientCircleColor = gradientCircleColor,
cardBackgroundAlpha = cardBackgroundAlpha,
circleColor = circleColor
)
}
Column(
modifier = Modifier.fillMaxSize()
) {
Expand All @@ -182,15 +210,18 @@ fun NoteWineCard(
),
color = WineyTheme.colors.gray_50,
)
Image(
painter = painterResource(id = image),
contentDescription = "IMG_SPARKL_WINE",
contentScale = ContentScale.FillHeight,
modifier = Modifier
.fillMaxHeight(if (color == WineType.RED.type) 0.9f else 1f)
.align(Alignment.CenterHorizontally)
.offset(y = -10.dp)
)

if (thumbnail == null) {
Image(
painter = painterResource(id = image),
contentDescription = "IMG_WINE",
contentScale = ContentScale.FillHeight,
modifier = Modifier
.fillMaxHeight(if (color == WineType.RED.type) 0.9f else 1f)
.align(Alignment.CenterHorizontally)
.offset(y = -10.dp)
)
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ import com.teamwiney.ui.theme.WineyTheme
@Preview
fun NoteFeatureText(
name: String = "테스트",
enable: Boolean = false,
enabled: Boolean = false,
onClick: () -> Unit = {}
) {
Text(
text = name,
color = if (enable) WineyTheme.colors.gray_50 else WineyTheme.colors.gray_700,
color = if (enabled) WineyTheme.colors.gray_50 else WineyTheme.colors.gray_700,
style = WineyTheme.typography.captionB1,
modifier = Modifier
.clip(RoundedCornerShape(40.dp))
.border(
BorderStroke(
1.dp, if (enable) WineyTheme.colors.main_2 else WineyTheme.colors.gray_700
1.dp, if (enabled) WineyTheme.colors.main_2 else WineyTheme.colors.gray_700
),
RoundedCornerShape(40.dp)
)
.background(if (enable) WineyTheme.colors.main_2 else Color.Transparent)
.background(if (enabled) WineyTheme.colors.main_2 else Color.Transparent)
.clickable {
onClick()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ fun WineSmellFeature(noteDetail: TastingNoteDetail) {
horizontalArrangement = Arrangement.spacedBy(5.dp),
verticalAlignment = Alignment.CenterVertically
) {
items(noteDetail.smellKeywordList) {
items(noteDetail.smellKeywordList + noteDetail.directKeywordList) {
NoteFeatureText(
name = it,
)
Expand Down
Loading

0 comments on commit 82d26dc

Please sign in to comment.