-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
19 changed files
with
262 additions
and
32 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
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
7 changes: 7 additions & 0 deletions
7
data/src/main/java/co/orange/data/dataSource/SellDataSource.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,8 +1,15 @@ | ||
package co.orange.data.dataSource | ||
|
||
import co.orange.data.dto.BaseResponse | ||
import co.orange.data.dto.request.SellCheckRequestDto | ||
import co.orange.data.dto.response.SellCheckedProductDto | ||
import co.orange.data.dto.response.SellProductDto | ||
import co.orange.data.dto.response.SignedUrlDto | ||
|
||
interface SellDataSource { | ||
suspend fun getSignedUrl(fileName: String): BaseResponse<SignedUrlDto> | ||
|
||
suspend fun postToCheckProduct(request: SellCheckRequestDto): BaseResponse<SellCheckedProductDto> | ||
|
||
suspend fun getProductToSell(productId: String): BaseResponse<SellProductDto> | ||
} |
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
data/src/main/java/co/orange/data/dto/request/SellCheckRequestDto.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 co.orange.data.dto.request | ||
|
||
import co.orange.domain.entity.request.SellCheckRequestModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class SellCheckRequestDto( | ||
@SerialName("image_url") | ||
val imageUrl: String, | ||
) { | ||
companion object { | ||
fun SellCheckRequestModel.toDto() = SellCheckRequestDto(imageUrl) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
data/src/main/java/co/orange/data/dto/response/SellCheckedProductDto.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 co.orange.data.dto.response | ||
|
||
import co.orange.domain.entity.response.SellCheckedProductModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class SellCheckedProductDto( | ||
@SerialName("productId") | ||
val productId: String, | ||
@SerialName("productName") | ||
val productName: String, | ||
) { | ||
fun toModel() = SellCheckedProductModel(productId, productName) | ||
} |
21 changes: 21 additions & 0 deletions
21
data/src/main/java/co/orange/data/dto/response/SellProductDto.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,21 @@ | ||
package co.orange.data.dto.response | ||
|
||
import co.orange.domain.entity.response.SellProductModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class SellProductDto( | ||
@SerialName("productId") | ||
val productId: String, | ||
@SerialName("productName") | ||
val productName: String, | ||
@SerialName("originPrice") | ||
val originPrice: Int, | ||
@SerialName("salePrice") | ||
val salePrice: Int, | ||
@SerialName("isAddressExist") | ||
val isAddressExist: Boolean, | ||
) { | ||
fun toModel() = SellProductModel(productId, productName, originPrice, salePrice, isAddressExist) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,29 @@ | ||
package co.orange.data.service | ||
|
||
import co.orange.data.dto.BaseResponse | ||
import co.orange.data.dto.request.SellCheckRequestDto | ||
import co.orange.data.dto.response.SellCheckedProductDto | ||
import co.orange.data.dto.response.SellProductDto | ||
import co.orange.data.dto.response.SignedUrlDto | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.Path | ||
import retrofit2.http.Query | ||
|
||
interface SellService { | ||
@GET("/api/v1/item/signed-url") | ||
suspend fun getSignedUrl( | ||
@Query("fileName") fileName: String, | ||
): BaseResponse<SignedUrlDto> | ||
|
||
@POST("/api/v1/item/check") | ||
suspend fun postToCheckProduct( | ||
@Body request: SellCheckRequestDto, | ||
): BaseResponse<SellCheckedProductDto> | ||
|
||
@GET("/api/v1/item/product/{id}") | ||
suspend fun getProductToSell( | ||
@Path("id") productId: String, | ||
): BaseResponse<SellProductDto> | ||
} |
5 changes: 5 additions & 0 deletions
5
domain/src/main/kotlin/co/orange/domain/entity/request/SellCheckRequestModel.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,5 @@ | ||
package co.orange.domain.entity.request | ||
|
||
data class SellCheckRequestModel( | ||
val imageUrl: String, | ||
) |
6 changes: 6 additions & 0 deletions
6
domain/src/main/kotlin/co/orange/domain/entity/response/SellCheckedProductModel.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,6 @@ | ||
package co.orange.domain.entity.response | ||
|
||
data class SellCheckedProductModel( | ||
val productId: String, | ||
val productName: String, | ||
) |
3 changes: 2 additions & 1 deletion
3
domain/src/main/kotlin/co/orange/domain/entity/response/SellProductModel.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,8 +1,9 @@ | ||
package co.orange.domain.entity.response | ||
|
||
data class SellProductModel( | ||
val productId: Long, | ||
val productId: String, | ||
val productName: String, | ||
val originPrice: Int, | ||
val salePrice: Int, | ||
val isAddressExist: Boolean, | ||
) |
7 changes: 7 additions & 0 deletions
7
domain/src/main/kotlin/co/orange/domain/repository/SellRepository.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,7 +1,14 @@ | ||
package co.orange.domain.repository | ||
|
||
import co.orange.domain.entity.request.SellCheckRequestModel | ||
import co.orange.domain.entity.response.SellCheckedProductModel | ||
import co.orange.domain.entity.response.SellProductModel | ||
import co.orange.domain.entity.response.SignedUrlModel | ||
|
||
interface SellRepository { | ||
suspend fun getSignedUrl(fileName: String): Result<SignedUrlModel> | ||
|
||
suspend fun postToCheckProduct(request: SellCheckRequestModel): Result<SellCheckedProductModel> | ||
|
||
suspend fun getProductToSell(productId: String): Result<SellProductModel> | ||
} |
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.