-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] Onboarding Content API 연동 #155
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
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
be0fc02
feat: 중첩네비, SharedViewModel 추가
ckals413 15d914b
style: TopAppBar padding 수정
ckals413 e18d1f5
style: ProfieImage로 변경
ckals413 d1ec2d0
feat: 온보딩 프로필 설정 화면 UI 상태 및 로직 구현
ckals413 b07b913
feat: 닉네임 중복 api 연결
ckals413 9214c7d
refactor: 버튼 state 및 onClick 로직 수정
ckals413 afac639
Merge remote-tracking branch 'origin/develop' into feat/#150-onboardi…
ckals413 e4655fb
feat: 온보딩 콘텐츠 검색 API 연동
ckals413 80e0355
feat: 온보딩 프로필 설정 화면 문구 수정 및 파일명 변경
ckals413 48bfd5f
refactor: 온보딩 화면을 삭제
ckals413 58b7170
fix: ContentItemDto non-nullable로 변경
ckals413 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
22 changes: 22 additions & 0 deletions
22
app/src/main/java/com/flint/core/common/extension/sharedViewModel.kt
This file contains hidden or 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,22 @@ | ||
| package com.flint.core.common.extension | ||
|
|
||
| import androidx.compose.runtime.Composable | ||
| import androidx.compose.runtime.remember | ||
| import androidx.hilt.navigation.compose.hiltViewModel | ||
| import androidx.lifecycle.ViewModel | ||
| import androidx.navigation.NavBackStackEntry | ||
| import androidx.navigation.NavHostController | ||
|
|
||
| /** | ||
| * 공용 뷰모델을 불러오기 위한 함수 | ||
| * */ | ||
| @Composable | ||
| inline fun <reified T : ViewModel> NavBackStackEntry.sharedViewModel( | ||
| navController: NavHostController, | ||
| ): T { | ||
| val navGraphRoute = destination.parent?.route ?: return hiltViewModel() | ||
| val parentEntry = remember(this) { | ||
| navController.getBackStackEntry(navGraphRoute) | ||
| } | ||
| return hiltViewModel(parentEntry) | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
30 changes: 30 additions & 0 deletions
30
app/src/main/java/com/flint/data/dto/response/ContentSearchResponseDto.kt
This file contains hidden or 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,30 @@ | ||
| package com.flint.data.dto.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class ContentSearchResponseDto( | ||
| @SerialName("data") val contents: List<ContentItemDto>, | ||
| @SerialName("meta") val meta: PageMetaDto, | ||
| ) | ||
|
|
||
| // TODO: null 처리를 어떻게? 어떤거가 null가능인지 | ||
| @Serializable | ||
| data class ContentItemDto( | ||
| @SerialName("contentId") val contentId: Long?, | ||
| @SerialName("title") val title: String?, | ||
| @SerialName("author") val author: String?, | ||
| @SerialName("posterUrl") val posterUrl: String?, | ||
| @SerialName("year") val year: Int?, | ||
| ) | ||
|
|
||
| @Serializable | ||
| data class PageMetaDto( | ||
| @SerialName("type") val type: String, | ||
| @SerialName("returned") val returned: Int, | ||
| @SerialName("currentPage") val currentPage: Int, | ||
| @SerialName("totalPages") val totalPages: Int, | ||
| @SerialName("totalElements") val totalElements: Int, | ||
| @SerialName("nextCursor") val nextCursor: String?, | ||
| ) | ||
24 changes: 24 additions & 0 deletions
24
app/src/main/java/com/flint/data/dto/search/SearchContentsResponseDto.kt
This file contains hidden or 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.flint.data.dto.search | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class SearchContentsResponseDto( | ||
| @SerialName("contents") | ||
| val contents: List<Content> | ||
| ) { | ||
| @Serializable | ||
| data class Content( | ||
| @SerialName("id") | ||
| val id: String, | ||
| @SerialName("title") | ||
| val title: String, | ||
| @SerialName("author") | ||
| val author: String, | ||
| @SerialName("posterUrl") | ||
| val posterUrl: String, | ||
| @SerialName("year") | ||
| val year: Int | ||
| ) | ||
| } |
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/flint/data/dto/user/response/NicknameCheckResponseDto.kt
This file contains hidden or 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,10 @@ | ||
| package com.flint.data.dto.user.response | ||
|
|
||
| import kotlinx.serialization.SerialName | ||
| import kotlinx.serialization.Serializable | ||
|
|
||
| @Serializable | ||
| data class NicknameCheckResponseDto( | ||
| @SerialName("available") | ||
| val available: Boolean | ||
| ) |
25 changes: 25 additions & 0 deletions
25
app/src/main/java/com/flint/domain/mapper/search/SearchContentMapper.kt
This file contains hidden or 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,25 @@ | ||
| package com.flint.domain.mapper.search | ||
|
|
||
| import com.flint.data.dto.search.SearchContentsResponseDto | ||
| import com.flint.domain.model.search.SearchContentItemModel | ||
| import com.flint.domain.model.search.SearchContentListModel | ||
| import kotlinx.collections.immutable.toImmutableList | ||
|
|
||
| fun SearchContentsResponseDto.toModel(): SearchContentListModel { | ||
| return SearchContentListModel( | ||
| contents = this.contents.map { it.toModel() }.toImmutableList() | ||
| ) | ||
| } | ||
|
|
||
| private fun SearchContentsResponseDto.Content.toModel(): SearchContentItemModel{ | ||
| return SearchContentItemModel( | ||
| id = id, | ||
| title = title, | ||
| author = author, | ||
| posterUrl = posterUrl, | ||
| year = year | ||
| ) | ||
| } | ||
|
|
||
|
|
||
|
|
10 changes: 10 additions & 0 deletions
10
app/src/main/java/com/flint/domain/mapper/user/UserMapper.kt
This file contains hidden or 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,10 @@ | ||
| package com.flint.domain.mapper.user | ||
|
|
||
| import com.flint.data.dto.user.response.NicknameCheckResponseDto | ||
| import com.flint.domain.model.user.NicknameCheckModel | ||
|
|
||
| fun NicknameCheckResponseDto.toModel(): NicknameCheckModel { | ||
| return NicknameCheckModel( | ||
| isAvailable = this.available | ||
| ) | ||
| } |
85 changes: 85 additions & 0 deletions
85
app/src/main/java/com/flint/domain/model/search/SearchContentItemModel.kt
This file contains hidden or 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,85 @@ | ||
| package com.flint.domain.model.search | ||
|
|
||
| import kotlinx.collections.immutable.ImmutableList | ||
| import kotlinx.collections.immutable.persistentListOf | ||
|
|
||
| data class SearchContentItemModel( | ||
| val id: String, | ||
| val title: String, | ||
| val author: String, | ||
| val posterUrl: String, | ||
| val year: Int, | ||
| ) | ||
|
|
||
| data class SearchContentListModel( | ||
| val contents: ImmutableList<SearchContentItemModel> | ||
| ) { | ||
| companion object { | ||
| val FakeList = | ||
| persistentListOf( | ||
| SearchContentItemModel( | ||
| id = "1", | ||
| title = "은하수를 여행하는 히치하이커를 위한 안내서", | ||
| author = "가스 제닝스", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2005, | ||
| ), | ||
| SearchContentItemModel( | ||
| id = "2", | ||
| title = "인터스텔라", | ||
| author = "크리스토퍼 놀란", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2014, | ||
| ), | ||
| SearchContentItemModel( | ||
| id = "3", | ||
| title = "인셉션", | ||
| author = "크리스토퍼 놀란", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2010, | ||
| ), | ||
| SearchContentItemModel( | ||
| id = "4", | ||
| title = "기생충", | ||
| author = "봉준호", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2019, | ||
| ), | ||
| SearchContentItemModel( | ||
| id = "5", | ||
| title = "어벤져스: 엔드게임", | ||
| author = "안소니 루소", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2019, | ||
| ), | ||
| SearchContentItemModel( | ||
| id = "6", | ||
| title = "다크 나이트", | ||
| author = "크리스토퍼 놀란", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2008, | ||
| ), | ||
| SearchContentItemModel( | ||
| id = "7", | ||
| title = "오펜하이머", | ||
| author = "크리스토퍼 놀란", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2023, | ||
| ), | ||
| SearchContentItemModel( | ||
| id = "8", | ||
| title = "괴물", | ||
| author = "봉준호", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2006, | ||
| ), | ||
| SearchContentItemModel( | ||
| id = "9", | ||
| title = "설국열차", | ||
| author = "봉준호", | ||
| posterUrl = "https://image.tmdb.org/t/p/w500/ib6v6qUXzez1x2qIOLN7C0yJNPQ.jpg", | ||
| year = 2013, | ||
| ), | ||
| ) | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
app/src/main/java/com/flint/domain/model/user/NicknameCheckModel.kt
This file contains hidden or 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,5 @@ | ||
| package com.flint.domain.model.user | ||
|
|
||
| data class NicknameCheckModel( | ||
| val isAvailable: Boolean | ||
| ) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
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.
이거 서버샘들께 여쭤본 거 아니었나요? 👀
왜 다 nullable이죠
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.
shelf에서 바꾸다가 까먹어서 nullable은 다 제거했습니당