-
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
13 changed files
with
234 additions
and
7 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
data/src/main/java/co/orange/data/dataSource/SettingDataSource.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,17 @@ | ||
package co.orange.data.dataSource | ||
|
||
import co.orange.data.dto.BaseResponse | ||
import co.orange.data.dto.request.AddressRequestDto | ||
import co.orange.data.dto.response.AddressDto | ||
import co.orange.data.dto.response.SettingInfoDto | ||
|
||
interface SettingDataSource { | ||
suspend fun getSettingInfo(): BaseResponse<SettingInfoDto> | ||
|
||
suspend fun postToAddAddress(request: AddressRequestDto): BaseResponse<AddressDto> | ||
|
||
suspend fun putToModAddress( | ||
addressId: Long, | ||
request: AddressRequestDto, | ||
): BaseResponse<AddressDto> | ||
} |
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/co/orange/data/dto/request/AddressRequestDto.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 co.orange.data.dto.request | ||
|
||
import co.orange.domain.entity.request.AddressRequestModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class AddressRequestDto( | ||
@SerialName("name") | ||
val name: String, | ||
@SerialName("zipCode") | ||
val zipCode: String, | ||
@SerialName("type") | ||
val type: String, | ||
@SerialName("address") | ||
val address: String, | ||
@SerialName("detailAddress") | ||
val detailAddress: String, | ||
@SerialName("phone") | ||
val phone: String, | ||
) { | ||
companion object { | ||
fun AddressRequestModel.toDto() = AddressRequestDto(name, zipCode, type, address, detailAddress, phone) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
data/src/main/java/co/orange/data/dto/response/AddressDto.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 co.orange.data.dto.response | ||
|
||
import co.orange.domain.entity.response.AddressModel | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class AddressDto( | ||
@SerialName("addressId") | ||
val addressId: Long, | ||
@SerialName("name") | ||
val name: String?, | ||
@SerialName("zipCode") | ||
val zipCode: String, | ||
@SerialName("type") | ||
val type: String, | ||
@SerialName("address") | ||
val address: String, | ||
@SerialName("detailAddress") | ||
val detailAddress: String, | ||
@SerialName("phone") | ||
val phone: String?, | ||
) { | ||
fun toModel() = AddressModel(addressId, name, zipCode, type, address, detailAddress, phone) | ||
} |
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
17 changes: 17 additions & 0 deletions
17
data/src/main/java/co/orange/data/service/SettingService.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,10 +1,27 @@ | ||
package co.orange.data.service | ||
|
||
import co.orange.data.dto.BaseResponse | ||
import co.orange.data.dto.request.AddressRequestDto | ||
import co.orange.data.dto.response.AddressDto | ||
import co.orange.data.dto.response.SettingInfoDto | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.PUT | ||
import retrofit2.http.Path | ||
|
||
interface SettingService { | ||
@GET("/api/v1/mypage/setting") | ||
suspend fun getSettingInfo(): BaseResponse<SettingInfoDto> | ||
|
||
@POST("/api/v1/mypage/setting/address") | ||
suspend fun postToAddAddress( | ||
@Body request: AddressRequestDto, | ||
): BaseResponse<AddressDto> | ||
|
||
@PUT("/api/v1/mypage/setting/address/{id}") | ||
suspend fun putToModAddress( | ||
@Path("id") addressId: Long, | ||
@Body request: AddressRequestDto, | ||
): BaseResponse<AddressDto> | ||
} |
10 changes: 10 additions & 0 deletions
10
domain/src/main/kotlin/co/orange/domain/entity/request/AddressRequestModel.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 co.orange.domain.entity.request | ||
|
||
data class AddressRequestModel( | ||
val name: String, | ||
val zipCode: String, | ||
val type: String, | ||
val address: String, | ||
val detailAddress: String, | ||
val phone: String, | ||
) |
11 changes: 11 additions & 0 deletions
11
domain/src/main/kotlin/co/orange/domain/entity/response/AddressModel.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,11 @@ | ||
package co.orange.domain.entity.response | ||
|
||
data class AddressModel( | ||
val addressId: Long, | ||
val name: String?, | ||
val zipCode: String, | ||
val type: String, | ||
val address: String, | ||
val detailAddress: String, | ||
val phone: String?, | ||
) |
9 changes: 9 additions & 0 deletions
9
domain/src/main/kotlin/co/orange/domain/repository/SettingRepository.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,16 @@ | ||
package co.orange.domain.repository | ||
|
||
import co.orange.domain.entity.request.AddressRequestModel | ||
import co.orange.domain.entity.response.AddressModel | ||
import co.orange.domain.entity.response.SettingInfoModel | ||
|
||
interface SettingRepository { | ||
suspend fun getSettingInfo(): Result<SettingInfoModel> | ||
|
||
suspend fun postToAddAddress(request: AddressRequestModel): Result<AddressModel> | ||
|
||
suspend fun putToModAddress( | ||
addressId: Long, | ||
request: AddressRequestModel, | ||
): Result<AddressModel> | ||
} |
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