Skip to content

Commit

Permalink
Merge branch 'develop' into feat-product-detail-view
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/java/org/sopt/kream/data/service/ProductService.kt
  • Loading branch information
jihyunniiii committed May 23, 2024
2 parents fcffe05 + 32c98e7 commit 5f3503f
Show file tree
Hide file tree
Showing 18 changed files with 655 additions and 5 deletions.
5 changes: 5 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ dependencies {

// Coil
implementation(libs.coil)
implementation(libs.coil.compose)

// Network
implementation(platform(libs.okhttp.bom))
implementation(libs.bundles.okhttp)
implementation(libs.bundles.retrofit)
implementation(libs.kotlin.serialization.json)

// Pager
implementation(libs.accompanist.pager.v02413rc)
implementation(libs.accompanist.pager.indicators.v02413rc)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.sopt.kream.data.model.request

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class RequestDeleteScrapDto(
@SerialName("memberId")
val memberId: String,
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package org.sopt.kream.data.model.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class ResponseDeleteScrapDto(
@SerialName("productId")
val productId: List<DeleteScrapResponseDto>,
) {
@Serializable
data class DeleteScrapResponseDto(
@SerialName("status")
val status: Int,
@SerialName("message")
val message: String,
@SerialName("data")
val data: String,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package org.sopt.kream.data.model.response

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class ResponseReleaseProductDto(
@SerialName("releaseProducts")
val releaseProducts: List<ReleaseProductResponseDto>,
) {
@Serializable
data class ReleaseProductResponseDto(
@SerialName("thumbnailUrl")
val thumbnailUrl: String,
@SerialName("brandTitle")
val brandTitle: String,
@SerialName("engTitle")
val engTitle: String,
@SerialName("isScrap")
var isScrap: Boolean,
@SerialName("isUpdate")
val isUpdate: Boolean,
@SerialName("isNew")
val isNew: Boolean,
)
}
12 changes: 12 additions & 0 deletions app/src/main/java/org/sopt/kream/data/service/ProductService.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package org.sopt.kream.data.service

import org.sopt.kream.data.model.response.ResponseProductDetailDto
import org.sopt.kream.data.model.response.ResponseReleaseProductDto
import org.sopt.kream.data.model.response.ResponseSearchProductDto
import org.sopt.kream.util.base.BaseResponse
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.Path
Expand All @@ -20,6 +22,16 @@ interface ProductService {
@Path("productId") productId: Int,
): BaseResponse<ResponseProductDetailDto>

@GET("product/release")
suspend fun getReleaseProduct(
@Header("memberId") userid: Int,
): BaseResponse<ResponseReleaseProductDto>

@DELETE("product/release")
suspend fun deleteScrap(
@Header("memberId") userid: Int,
): BaseResponse<ResponseReleaseProductDto>

companion object {
const val MEMBER_ID = 1
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.sopt.kream.presentation.ui.main.home.release

import org.sopt.kream.R

data class Advertisement(
val id: Int,
val imgResource: Int,
)

enum class AdvertisementType(val imgResource: Int) {
AD_01(R.drawable.img_view1_ad_01),
AD_02(R.drawable.img_view1_ad_02),
AD_03(R.drawable.img_view1_ad_03),
AD_04(R.drawable.img_view1_ad_04),
}
Loading

0 comments on commit 5f3503f

Please sign in to comment.