-
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
41 changed files
with
580 additions
and
255 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
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
8 changes: 8 additions & 0 deletions
8
data/src/main/java/co/orange/data/dataSource/BuyDataSource.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,8 @@ | ||
package co.orange.data.dataSource | ||
|
||
import co.orange.data.dto.BaseResponse | ||
import co.orange.data.dto.response.BuyProgressDto | ||
|
||
interface BuyDataSource { | ||
suspend fun getBuyProgressData(productId: String): BaseResponse<BuyProgressDto> | ||
} |
15 changes: 15 additions & 0 deletions
15
data/src/main/java/co/orange/data/dataSourceImpl/BuyDataSourceImpl.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.dataSourceImpl | ||
|
||
import co.orange.data.dataSource.BuyDataSource | ||
import co.orange.data.dto.BaseResponse | ||
import co.orange.data.dto.response.BuyProgressDto | ||
import co.orange.data.service.BuyService | ||
import javax.inject.Inject | ||
|
||
data class BuyDataSourceImpl | ||
@Inject | ||
constructor( | ||
private val buyService: BuyService, | ||
) : BuyDataSource { | ||
override suspend fun getBuyProgressData(productId: String): BaseResponse<BuyProgressDto> = buyService.getBuyProgressData(productId) | ||
} |
19 changes: 19 additions & 0 deletions
19
data/src/main/java/co/orange/data/dto/response/AddressInfoDto.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,19 @@ | ||
package co.orange.data.dto.response | ||
|
||
import co.orange.domain.entity.response.AddressInfoModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class AddressInfoDto( | ||
@SerialName("recipient") | ||
val recipient: String? = null, | ||
@SerialName("zipCode") | ||
val zipCode: String? = null, | ||
@SerialName("address") | ||
val address: String? = null, | ||
@SerialName("recipientPhone") | ||
val recipientPhone: String? = null, | ||
) { | ||
fun toModel() = AddressInfoModel(recipient, zipCode, address, recipientPhone) | ||
} |
37 changes: 37 additions & 0 deletions
37
data/src/main/java/co/orange/data/dto/response/BuyProgressDto.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,37 @@ | ||
package co.orange.data.dto.response | ||
|
||
import co.orange.domain.entity.response.BuyProgressModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class BuyProgressDto( | ||
@SerialName("itemId") | ||
val itemId: String, | ||
@SerialName("productName") | ||
val productName: String, | ||
@SerialName("imgUrl") | ||
val imgUrl: String, | ||
@SerialName("originPrice") | ||
val originPrice: Int, | ||
@SerialName("addressInfo") | ||
val addressInfo: AddressInfoDto, | ||
@SerialName("discountPrice") | ||
val discountPrice: Int, | ||
@SerialName("charge") | ||
val charge: Int, | ||
@SerialName("totalPrice") | ||
val totalPrice: Int, | ||
) { | ||
fun toModel() = | ||
BuyProgressModel( | ||
itemId, | ||
productName, | ||
imgUrl, | ||
originPrice, | ||
addressInfo.toModel(), | ||
discountPrice, | ||
charge, | ||
totalPrice, | ||
) | ||
} |
17 changes: 17 additions & 0 deletions
17
data/src/main/java/co/orange/data/repositoryImpl/BuyRepositoryImpl.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,17 @@ | ||
package co.orange.data.repositoryImpl | ||
|
||
import co.orange.data.dataSource.BuyDataSource | ||
import co.orange.domain.entity.response.BuyProgressModel | ||
import co.orange.domain.repository.BuyRepository | ||
import javax.inject.Inject | ||
|
||
class BuyRepositoryImpl | ||
@Inject | ||
constructor( | ||
private val buyDataSource: BuyDataSource, | ||
) : BuyRepository { | ||
override suspend fun getBuyProgressData(productId: String): Result<BuyProgressModel> = | ||
runCatching { | ||
buyDataSource.getBuyProgressData(productId).data.toModel() | ||
} | ||
} |
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,13 @@ | ||
package co.orange.data.service | ||
|
||
import co.orange.data.dto.BaseResponse | ||
import co.orange.data.dto.response.BuyProgressDto | ||
import retrofit2.http.GET | ||
import retrofit2.http.Path | ||
|
||
interface BuyService { | ||
@GET("/api/v1/order/product/{id}") | ||
suspend fun getBuyProgressData( | ||
@Path("id") productId: String, | ||
): BaseResponse<BuyProgressDto> | ||
} |
10 changes: 5 additions & 5 deletions
10
domain/src/main/kotlin/co/orange/domain/entity/response/AddressInfoModel.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,8 @@ | ||
package co.orange.domain.entity.response | ||
|
||
data class AddressInfoModel( | ||
val recipient: String, | ||
val zipCode: String, | ||
val address: String, | ||
val phone: String | ||
) | ||
val recipient: String? = null, | ||
val zipCode: String? = null, | ||
val address: String? = null, | ||
val recipientPhone: String? = null, | ||
) |
17 changes: 0 additions & 17 deletions
17
domain/src/main/kotlin/co/orange/domain/entity/response/BuyDetailModel.kt
This file was deleted.
Oops, something went wrong.
8 changes: 7 additions & 1 deletion
8
domain/src/main/kotlin/co/orange/domain/entity/response/BuyInfoModel.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,11 +1,17 @@ | ||
package co.orange.domain.entity.response | ||
|
||
import co.orange.domain.enums.OrderStatus | ||
|
||
data class BuyInfoModel( | ||
val orderId: String, | ||
val orderStatus: OrderStatus, | ||
val productName: String, | ||
val imgUrl: String, | ||
val originPrice: Int, | ||
val sellerNickname: String, | ||
val addressInfo: List<AddressInfoModel>, | ||
val paymentInfo: List<PaymentInfoModel>, | ||
val discountPrice: Int, | ||
val charge: Int, | ||
val totalPrice: Int, | ||
) | ||
) |
12 changes: 12 additions & 0 deletions
12
domain/src/main/kotlin/co/orange/domain/entity/response/BuyProgressModel.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,12 @@ | ||
package co.orange.domain.entity.response | ||
|
||
data class BuyProgressModel( | ||
val itemId: String, | ||
val productName: String, | ||
val imgUrl: String, | ||
val originPrice: Int, | ||
val addressInfo: AddressInfoModel, | ||
val discountPrice: Int, | ||
val charge: Int, | ||
val totalPrice: Int, | ||
) |
18 changes: 0 additions & 18 deletions
18
domain/src/main/kotlin/co/orange/domain/entity/response/SellDetailModel.kt
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
domain/src/main/kotlin/co/orange/domain/entity/response/SellInfoModel.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,18 @@ | ||
package co.orange.domain.entity.response | ||
|
||
import co.orange.domain.enums.ItemStatus | ||
import co.orange.domain.enums.OrderStatus | ||
|
||
data class SellInfoModel( | ||
val itemId: String, | ||
val itemStatus: ItemStatus, | ||
val productName: String, | ||
val imgUrl: String, | ||
val originPrice: Int, | ||
val salePrice: Int, | ||
val orderId: String, | ||
val orderStatus: OrderStatus, | ||
val buyerNickname: String, | ||
val addressInfo: List<AddressInfoModel>, | ||
val paymentInfo: List<PaymentInfoModel>, | ||
) |
7 changes: 7 additions & 0 deletions
7
domain/src/main/kotlin/co/orange/domain/entity/response/SellProgressModel.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,7 @@ | ||
package co.orange.domain.entity.response | ||
|
||
data class SellProgressModel( | ||
val itemId: String, | ||
val productName: String, | ||
val originPrice: Int, | ||
) |
7 changes: 7 additions & 0 deletions
7
domain/src/main/kotlin/co/orange/domain/repository/BuyRepository.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,7 @@ | ||
package co.orange.domain.repository | ||
|
||
import co.orange.domain.entity.response.BuyProgressModel | ||
|
||
interface BuyRepository { | ||
suspend fun getBuyProgressData(productId: String): Result<BuyProgressModel> | ||
} |
Oops, something went wrong.