-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEAT/#117] 장소 검색 API 세팅 #121
Merged
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
f3ec0f1
[FEAT/#117] 장소 검색 API 세팅
angryPodo 1340a59
[FEAT/#117] 장소 검색 API 세팅
angryPodo 5711f6a
[MOD/#117] 린트 오류 수정
angryPodo be2bc37
Merge remote-tracking branch 'origin/develop' into feat/#117-place-se…
angryPodo e1d9e0d
Merge remote-tracking branch 'origin/develop' into feat/#117-place-se…
angryPodo 4348c27
[MOD/#117] 장소 검색 리뷰 사항 반영
angryPodo b4b54da
[MOD/#117] 코드 리뷰 수정 사항 반영
angryPodo 210668e
Merge remote-tracking branch 'origin/develop' into feat/#117-place-se…
angryPodo ead1ef5
[MOD/#117] 네이밍 변경
angryPodo 63b98f1
[MOD/#122] lint 오류 수정
angryPodo 13b8f42
[MOD/#177] CI 오류 수정
angryPodo 4921eae
[MOD/#177] baseResponse 삭제
angryPodo 4229433
[MOD/#117] mapper 함수 생성
angryPodo 60e87fb
[MOD/#117] mapper 함수 생성
angryPodo fae9c68
Merge remote-tracking branch 'origin/develop' into feat/#117-place-se…
angryPodo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
app/src/main/java/com/spoony/spoony/data/datasource/PlaceDataSource.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 com.spoony.spoony.data.datasource | ||
|
||
import com.spoony.spoony.data.dto.response.BaseResponse | ||
import com.spoony.spoony.data.dto.response.SearchPlaceResponseDto | ||
|
||
interface PlaceDataSource { | ||
suspend fun getPlaces(query: String, display: Int): BaseResponse<SearchPlaceResponseDto> | ||
} |
17 changes: 17 additions & 0 deletions
17
app/src/main/java/com/spoony/spoony/data/datasourceimpl/PlaceDataSourceImpl.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.spoony.spoony.data.datasourceimpl | ||
|
||
import com.spoony.spoony.data.datasource.PlaceDataSource | ||
import com.spoony.spoony.data.dto.response.BaseResponse | ||
import com.spoony.spoony.data.dto.response.SearchPlaceResponseDto | ||
import com.spoony.spoony.data.service.PlaceService | ||
import javax.inject.Inject | ||
|
||
class PlaceDataSourceImpl @Inject constructor( | ||
private val placeService: PlaceService | ||
) : PlaceDataSource { | ||
override suspend fun getPlaces( | ||
query: String, | ||
display: Int | ||
): BaseResponse<SearchPlaceResponseDto> = | ||
placeService.getPlaces(query, display) | ||
} |
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
20 changes: 20 additions & 0 deletions
20
app/src/main/java/com/spoony/spoony/data/dto/response/BaseResponse.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,20 @@ | ||
package com.spoony.spoony.data.dto.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class BaseResponse<T>( | ||
@SerialName("success") | ||
val success: Boolean, | ||
@SerialName("error") | ||
val error: ErrorResponse? = null, | ||
@SerialName("data") | ||
val data: T? = null | ||
) | ||
|
||
@Serializable | ||
data class ErrorResponse( | ||
@SerialName("message") | ||
val message: String | ||
) |
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/spoony/spoony/data/dto/response/PlaceResponseDto.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,24 @@ | ||
package com.spoony.spoony.data.dto.response | ||
|
||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
@Serializable | ||
data class SearchPlaceResponseDto( | ||
@SerialName("placeList") | ||
val placeList: List<PlaceResponseDto> | ||
) | ||
|
||
@Serializable | ||
data class PlaceResponseDto( | ||
@SerialName("placeName") | ||
val placeName: String, | ||
@SerialName("placeAddress") | ||
val placeAddress: String, | ||
@SerialName("placeRoadAddress") | ||
val placeRoadAddress: String, | ||
@SerialName("latitude") | ||
val latitude: Double, | ||
@SerialName("longitude") | ||
val longitude: Double | ||
) |
23 changes: 23 additions & 0 deletions
23
app/src/main/java/com/spoony/spoony/data/mapper/PlaceMapper.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,23 @@ | ||
package com.spoony.spoony.data.mapper | ||
|
||
import com.spoony.spoony.data.dto.response.PlaceResponseDto | ||
import com.spoony.spoony.domain.entity.PlaceEntity | ||
import com.spoony.spoony.presentation.register.model.Place | ||
|
||
fun PlaceResponseDto.toDomain(): PlaceEntity = | ||
PlaceEntity( | ||
placeName = placeName, | ||
placeAddress = placeAddress, | ||
placeRoadAddress = placeRoadAddress, | ||
latitude = latitude, | ||
longitude = longitude | ||
) | ||
|
||
fun PlaceEntity.toPresentation(): Place = | ||
Place( | ||
placeName = placeName, | ||
placeAddress = placeAddress, | ||
placeRoadAddress = placeRoadAddress, | ||
latitude = latitude, | ||
longitude = longitude | ||
) |
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
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/spoony/spoony/data/service/PlaceService.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,14 @@ | ||
package com.spoony.spoony.data.service | ||
|
||
import com.spoony.spoony.data.dto.response.BaseResponse | ||
import com.spoony.spoony.data.dto.response.SearchPlaceResponseDto | ||
import retrofit2.http.GET | ||
import retrofit2.http.Query | ||
|
||
interface PlaceService { | ||
@GET("api/v1/place/search") | ||
suspend fun getPlaces( | ||
@Query("query") query: String, | ||
@Query("display") display: Int = 5 | ||
): BaseResponse<SearchPlaceResponseDto> | ||
} |
9 changes: 9 additions & 0 deletions
9
app/src/main/java/com/spoony/spoony/domain/entity/PlaceEntity.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.spoony.spoony.domain.entity | ||
|
||
data class PlaceEntity( | ||
val placeName: String, | ||
val placeAddress: String, | ||
val placeRoadAddress: String, | ||
val latitude: Double, | ||
val longitude: Double | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: 어라라????? data레이어에서 presentation 레이어의 모델을 사용하네요?? 수정해주세요!!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
싹 수정했습니다!