Skip to content

Commit

Permalink
[feat/#34]: Info Item과 Page api model 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
NaZe0320 committed Feb 3, 2024
1 parent 46e386c commit a699afb
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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
)
Original file line number Diff line number Diff line change
@@ -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
)
7 changes: 7 additions & 0 deletions app/src/main/java/com/umc/coumo/domain/model/Status.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.umc.coumo.domain.model

enum class Status {
SUCCESS,
ERROR,
LOADING
}
12 changes: 12 additions & 0 deletions app/src/main/java/com/umc/coumo/utils/ApiResponse.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.umc.coumo.utils

import com.umc.coumo.domain.model.Status


data class ApiResponse<out T>(val status: Status, val data: T?, val throwable: Throwable?) {
companion object {
fun <T> success(data: T): ApiResponse<T> = ApiResponse(Status.SUCCESS, data, null)
fun <T> error(throwable: Throwable): ApiResponse<T> = ApiResponse(Status.ERROR, null, throwable)
fun <T> loading(data: T? = null): ApiResponse<T> = ApiResponse(Status.LOADING, data, null)
}
}

0 comments on commit a699afb

Please sign in to comment.