-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from FakeDevelopers/feature/BDBD-520
FEAT : BDBD-520 상품 상세 페이지 모듈화
- Loading branch information
Showing
18 changed files
with
113 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
data/src/main/java/com/fakedevelopers/data/repository/ProductDetailRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package com.fakedevelopers.data.repository | ||
|
||
import com.fakedevelopers.data.service.ProductDetailService | ||
import com.fakedevelopers.domain.model.ProductDetailInfo | ||
import com.fakedevelopers.domain.repository.ProductDetailRepository | ||
import javax.inject.Inject | ||
|
||
class ProductDetailRepositoryImpl @Inject constructor( | ||
private val service: ProductDetailService | ||
) : ProductDetailRepository { | ||
|
||
override suspend fun getProductDetail(productId: Long): Result<ProductDetailInfo> = | ||
runCatching { | ||
service.getProductDetail(productId) | ||
} | ||
|
||
override suspend fun postProductBid( | ||
productId: Long, | ||
userId: Long, | ||
bid: Long | ||
): Result<String> = | ||
runCatching { | ||
service.postProductBid(productId, userId, bid) | ||
} | ||
} |
10 changes: 5 additions & 5 deletions
10
...ation/api/service/ProductDetailService.kt → ...pers/data/service/ProductDetailService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package com.fakedevelopers.presentation.api.service | ||
package com.fakedevelopers.data.service | ||
|
||
import com.fakedevelopers.presentation.ui.productDetail.ProductDetailDto | ||
import retrofit2.Response | ||
import com.fakedevelopers.domain.model.ProductDetailInfo | ||
import retrofit2.http.Field | ||
import retrofit2.http.FormUrlEncoded | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.Path | ||
|
||
interface ProductDetailService { | ||
|
||
@GET("product/getProductInfo/{productId}") | ||
suspend fun getProductDetail( | ||
@Path("productId") productId: Long | ||
): Response<ProductDetailDto> | ||
): ProductDetailInfo | ||
|
||
@FormUrlEncoded | ||
@POST("product/{productId}/bid") | ||
suspend fun postProductBid( | ||
@Path("productId") productId: Long, | ||
@Field("userId") userId: Long, | ||
@Field("bid") bid: Long | ||
): Response<String> | ||
): String | ||
} |
2 changes: 1 addition & 1 deletion
2
.../presentation/ui/productDetail/BidInfo.kt → ...om/fakedevelopers/domain/model/BidInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...tion/ui/productDetail/ProductDetailDto.kt → ...elopers/domain/model/ProductDetailInfo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
domain/src/main/java/com/fakedevelopers/domain/repository/ProductDetailRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.fakedevelopers.domain.repository | ||
|
||
import com.fakedevelopers.domain.model.ProductDetailInfo | ||
|
||
interface ProductDetailRepository { | ||
suspend fun getProductDetail( | ||
productId: Long | ||
): Result<ProductDetailInfo> | ||
|
||
suspend fun postProductBid( | ||
productId: Long, | ||
userId: Long, | ||
bid: Long | ||
): Result<String> | ||
} |
10 changes: 10 additions & 0 deletions
10
domain/src/main/java/com/fakedevelopers/domain/usecase/GetProductDetailUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.fakedevelopers.domain.usecase | ||
|
||
import com.fakedevelopers.domain.repository.ProductDetailRepository | ||
import javax.inject.Inject | ||
|
||
class GetProductDetailUseCase @Inject constructor( | ||
private val repository: ProductDetailRepository | ||
) { | ||
suspend operator fun invoke(productId: Long) = repository.getProductDetail(productId) | ||
} |
10 changes: 10 additions & 0 deletions
10
domain/src/main/java/com/fakedevelopers/domain/usecase/PostProductBidUseCase.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.fakedevelopers.domain.usecase | ||
|
||
import com.fakedevelopers.domain.repository.ProductDetailRepository | ||
import javax.inject.Inject | ||
|
||
class PostProductBidUseCase @Inject constructor( | ||
private val repository: ProductDetailRepository | ||
) { | ||
suspend operator fun invoke(productId: Long, userId: Long, bid: Long) = repository.postProductBid(productId, userId, bid) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 0 additions & 24 deletions
24
...n/src/main/java/com/fakedevelopers/presentation/api/repository/ProductDetailRepository.kt
This file was deleted.
Oops, something went wrong.
13 changes: 0 additions & 13 deletions
13
...ation/src/main/java/com/fakedevelopers/presentation/api/repository/UserLoginRepository.kt
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
presentation/src/main/java/com/fakedevelopers/presentation/api/service/UserLoginService.kt
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.