diff --git a/app/src/main/java/com/umc/coumo/data/remote/model/request/RequestLocationModel.kt b/app/src/main/java/com/umc/coumo/data/remote/model/request/RequestLocationModel.kt new file mode 100644 index 0000000..b591ded --- /dev/null +++ b/app/src/main/java/com/umc/coumo/data/remote/model/request/RequestLocationModel.kt @@ -0,0 +1,6 @@ +package com.umc.coumo.data.remote.model.request + +data class RequestLocationModel( + val longitude: Double = 127.028194, + val latitude: Double = 37.498085 +) diff --git a/app/src/main/java/com/umc/coumo/data/remote/model/response/ResponsePopularStoreModel.kt b/app/src/main/java/com/umc/coumo/data/remote/model/response/ResponsePopularStoreModel.kt new file mode 100644 index 0000000..7a47a9c --- /dev/null +++ b/app/src/main/java/com/umc/coumo/data/remote/model/response/ResponsePopularStoreModel.kt @@ -0,0 +1,9 @@ +package com.umc.coumo.data.remote.model.response + +data class ResponsePopularStoreModel( + val storeId: Int, + val name: String, + val location: String, + val description: String, + val storeImage: String +) \ No newline at end of file diff --git a/app/src/main/java/com/umc/coumo/domain/model/Status.kt b/app/src/main/java/com/umc/coumo/domain/model/Status.kt new file mode 100644 index 0000000..c0ebab6 --- /dev/null +++ b/app/src/main/java/com/umc/coumo/domain/model/Status.kt @@ -0,0 +1,7 @@ +package com.umc.coumo.domain.model + +enum class Status { + SUCCESS, + ERROR, + LOADING +} \ No newline at end of file diff --git a/app/src/main/java/com/umc/coumo/utils/ApiResponse.kt b/app/src/main/java/com/umc/coumo/utils/ApiResponse.kt new file mode 100644 index 0000000..e4d2661 --- /dev/null +++ b/app/src/main/java/com/umc/coumo/utils/ApiResponse.kt @@ -0,0 +1,12 @@ +package com.umc.coumo.utils + +import com.umc.coumo.domain.model.Status + + +data class ApiResponse(val status: Status, val data: T?, val throwable: Throwable?) { + companion object { + fun success(data: T): ApiResponse = ApiResponse(Status.SUCCESS, data, null) + fun error(throwable: Throwable): ApiResponse = ApiResponse(Status.ERROR, null, throwable) + fun loading(data: T? = null): ApiResponse = ApiResponse(Status.LOADING, data, null) + } +} \ No newline at end of file