-
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.
Browse files
Browse the repository at this point in the history
…eview-api [Feautre/#32] : 리뷰 api 연결
- Loading branch information
Showing
20 changed files
with
274 additions
and
141 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
6 changes: 5 additions & 1 deletion
6
app/src/main/java/com/hackathon/alddeul_babsang/data/datasource/MapDataSource.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,14 @@ | ||
package com.hackathon.alddeul_babsang.data.datasource | ||
|
||
import com.hackathon.alddeul_babsang.data.dto.BaseResponse | ||
import com.hackathon.alddeul_babsang.data.dto.request.RequestMapStoreDetailDto | ||
import com.hackathon.alddeul_babsang.data.dto.response.ResponseMapStoreDetailDto | ||
import com.hackathon.alddeul_babsang.data.dto.response.ResponseMapStoresDto | ||
|
||
interface MapDataSource { | ||
suspend fun getMapStores(): BaseResponse<List<ResponseMapStoresDto>> | ||
suspend fun getMapStoreDetail(id: Long): BaseResponse<ResponseMapStoreDetailDto> | ||
suspend fun postMapStoreDetail( | ||
id: Long, | ||
requestMapStoreDetailDto: RequestMapStoreDetailDto | ||
): BaseResponse<ResponseMapStoreDetailDto> | ||
} |
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
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/hackathon/alddeul_babsang/data/dto/request/RequestMapStoreDetailDto.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,9 @@ | ||
package com.hackathon.alddeul_babsang.data.dto.request | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class RequestMapStoreDetailDto ( | ||
@SerialName("userId") val userId: Long, | ||
) |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/hackathon/alddeul_babsang/data/dto/response/ResponseGetReviewDto.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 com.hackathon.alddeul_babsang.data.dto.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class ResponseGetReviewDto ( | ||
@SerialName("reviewCnt") val reviewCnt: Int, | ||
@SerialName("reviewList") val reviewList: List<Review> | ||
) | ||
|
||
@Serializable | ||
data class Review ( | ||
@SerialName("nickname") val nickname: String, | ||
@SerialName("rate") val rate: Double, | ||
@SerialName("content") val content: String, | ||
) |
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
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
10 changes: 7 additions & 3 deletions
10
app/src/main/java/com/hackathon/alddeul_babsang/data/service/MapApiService.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,20 +1,24 @@ | ||
package com.hackathon.alddeul_babsang.data.service | ||
|
||
import com.hackathon.alddeul_babsang.data.dto.BaseResponse | ||
import com.hackathon.alddeul_babsang.data.dto.request.RequestMapStoreDetailDto | ||
import com.hackathon.alddeul_babsang.data.dto.response.ResponseMapStoreDetailDto | ||
import com.hackathon.alddeul_babsang.data.dto.response.ResponseMapStoresDto | ||
import com.sopt.data.service.ApiKeyStorage.ID | ||
import com.sopt.data.service.ApiKeyStorage.MAP | ||
import com.sopt.data.service.ApiKeyStorage.STORES | ||
import retrofit2.http.Body | ||
import retrofit2.http.GET | ||
import retrofit2.http.POST | ||
import retrofit2.http.Path | ||
|
||
interface MapApiService { | ||
@GET("/$MAP/$STORES") | ||
suspend fun getMapStores(): BaseResponse<List<ResponseMapStoresDto>> | ||
|
||
@GET("/$MAP/$STORES/{$ID}") | ||
suspend fun getMapStoreDetail( | ||
@Path("id") id: Long | ||
@POST("/$MAP/$STORES/{$ID}") | ||
suspend fun postMapStoreDetail( | ||
@Path("id") id: Long, | ||
@Body requestMapStoreDetailDto: RequestMapStoreDetailDto | ||
): BaseResponse<ResponseMapStoreDetailDto> | ||
} |
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.