-
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/#105] 탐색 뷰 더미데이터 연결 #106
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e14d6a8
[FEAT/#105] 카테고리 리스트 더미 연결
Hyobeen-Park 80041bf
[FEAT/#105] 카테고리 목록 조회 에러 케이스 추가
Hyobeen-Park 86b1211
[FEAT/#105] 피드 목록 조회 더미데이터
Hyobeen-Park 48faa97
[FEAT/#105] 장소 상세 뷰로 네비게이션 연결
Hyobeen-Park e877852
Merge remote-tracking branch 'origin/develop' into feat/#105-explore-…
Hyobeen-Park 286fe46
[FEAT/#105] runcatching 없애기
Hyobeen-Park e258009
[CHORE/#105] 코드 정리
Hyobeen-Park 3772f6e
Merge remote-tracking branch 'origin/develop' into feat/#105-explore-…
Hyobeen-Park 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
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
152 changes: 152 additions & 0 deletions
152
app/src/main/java/com/spoony/spoony/data/repositoryimpl/ExploreRepositoryImpl.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,152 @@ | ||
package com.spoony.spoony.data.repositoryimpl | ||
|
||
import com.spoony.spoony.domain.entity.CategoryEntity | ||
import com.spoony.spoony.domain.entity.FeedEntity | ||
import com.spoony.spoony.domain.repository.ExploreRepository | ||
import javax.inject.Inject | ||
|
||
class ExploreRepositoryImpl @Inject constructor() : ExploreRepository { | ||
override suspend fun getCategoryList(): Result<List<CategoryEntity>> = Result.success( | ||
listOf( | ||
CategoryEntity( | ||
categoryId = 1, | ||
categoryName = "전체", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/all_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/all_black.png" | ||
), | ||
CategoryEntity( | ||
categoryId = 2, | ||
categoryName = "로컬 수저", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/local_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/all_black.png" | ||
), | ||
CategoryEntity( | ||
categoryId = 3, | ||
categoryName = "한식", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/korean_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/korean_black.png" | ||
), | ||
CategoryEntity( | ||
categoryId = 4, | ||
categoryName = "일식", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/japanese_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/japanese_black.png" | ||
), | ||
CategoryEntity( | ||
categoryId = 5, | ||
categoryName = "중식", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/chinese_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/chinese_black.png" | ||
), | ||
CategoryEntity( | ||
categoryId = 6, | ||
categoryName = "양식", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/american_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/american_black.png" | ||
), | ||
CategoryEntity( | ||
categoryId = 7, | ||
categoryName = "퓨전/세계요리", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/world_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/world_black.png" | ||
), | ||
CategoryEntity( | ||
categoryId = 8, | ||
categoryName = "카페", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/cafe_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/cafe_black.png" | ||
), | ||
CategoryEntity( | ||
categoryId = 9, | ||
categoryName = "주류", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/drink_white.png", | ||
unSelectedIconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/drink_black.png" | ||
) | ||
) | ||
) | ||
|
||
override suspend fun getFeedList( | ||
userId: Int, | ||
categoryId: Int, | ||
locationQuery: String, | ||
sortBy: String | ||
): Result<List<FeedEntity>> = Result.success( | ||
listOf( | ||
FeedEntity( | ||
userId = 3, | ||
userName = "두더지", | ||
userRegion = "용산구", | ||
postId = 3, | ||
title = "스타벅스 삼성역섬유센터R점 리뷰", | ||
categoryInfo = CategoryEntity( | ||
categoryId = 2, | ||
categoryName = "카페", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/cafe_color.png", | ||
textColor = "FFE4E5", | ||
backgroundColor = "FF7E84" | ||
), | ||
zzimCount = 1 | ||
), | ||
FeedEntity( | ||
userId = 3, | ||
userName = "두더지", | ||
userRegion = "용산구", | ||
postId = 4, | ||
title = "스타벅스 삼성역섬유센터R점 리뷰", | ||
categoryInfo = CategoryEntity( | ||
categoryId = 2, | ||
categoryName = "카페", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/cafe_color.png", | ||
textColor = "FFE4E5", | ||
backgroundColor = "FF7E84" | ||
), | ||
zzimCount = 1 | ||
), | ||
FeedEntity( | ||
userId = 3, | ||
userName = "두더지", | ||
userRegion = "용산구", | ||
postId = 5, | ||
title = "스타벅스 삼성역섬유센터R점 리뷰", | ||
categoryInfo = CategoryEntity( | ||
categoryId = 2, | ||
categoryName = "카페", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/cafe_color.png", | ||
textColor = "FFE4E5", | ||
backgroundColor = "FF7E84" | ||
), | ||
zzimCount = 1 | ||
), | ||
FeedEntity( | ||
userId = 3, | ||
userName = "두더지", | ||
userRegion = "용산구", | ||
postId = 6, | ||
title = "스타벅스 삼성역섬유센터R점 리뷰", | ||
categoryInfo = CategoryEntity( | ||
categoryId = 2, | ||
categoryName = "카페", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/cafe_color.png", | ||
textColor = "FFE4E5", | ||
backgroundColor = "FF7E84" | ||
), | ||
zzimCount = 1 | ||
), | ||
FeedEntity( | ||
userId = 3, | ||
userName = "두더지", | ||
userRegion = "용산구", | ||
postId = 7, | ||
title = "스타벅스 삼성역섬유센터R점 리뷰", | ||
categoryInfo = CategoryEntity( | ||
categoryId = 2, | ||
categoryName = "카페", | ||
iconUrl = "https://spoony-storage.s3.ap-northeast-2.amazonaws.com/category/icons/cafe_color.png", | ||
textColor = "FFE4E5", | ||
backgroundColor = "FF7E84" | ||
), | ||
zzimCount = 1 | ||
) | ||
) | ||
) | ||
} |
11 changes: 11 additions & 0 deletions
11
app/src/main/java/com/spoony/spoony/domain/entity/FeedEntity.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 com.spoony.spoony.domain.entity | ||
|
||
data class FeedEntity( | ||
val userId: Int, | ||
val userName: String, | ||
val userRegion: String, | ||
val postId: Int, | ||
val title: String, | ||
val categoryInfo: CategoryEntity, | ||
val zzimCount: Int | ||
) |
15 changes: 15 additions & 0 deletions
15
app/src/main/java/com/spoony/spoony/domain/repository/ExploreRepository.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,15 @@ | ||
package com.spoony.spoony.domain.repository | ||
|
||
import com.spoony.spoony.domain.entity.CategoryEntity | ||
import com.spoony.spoony.domain.entity.FeedEntity | ||
|
||
interface ExploreRepository { | ||
suspend fun getCategoryList(): Result<List<CategoryEntity>> | ||
|
||
suspend fun getFeedList( | ||
userId: Int, | ||
categoryId: Int, | ||
locationQuery: String, | ||
sortBy: String | ||
): Result<List<FeedEntity>> | ||
} |
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
77 changes: 76 additions & 1 deletion
77
app/src/main/java/com/spoony/spoony/presentation/explore/ExploreViewModel.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
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.
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) Repository에서 이미 Result 객체로 보내주고 있는데 한번 더 runCatching으로 묶은 이유가 있을까요?
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.
제가 runCatching이 뭔지,,, 까먹었나봅니다,,,ㅋㅋㅋ큐ㅠ