-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Refactor#186] 탐색 기본 뷰 / 리팩토링 #190
Changes from 4 commits
2dfda7e
c45f472
9532e72
72d2114
26bc27d
d96e173
2a35377
13d3a67
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
package com.terning.data.dto.response | ||
|
||
import com.terning.domain.entity.response.SearchResultModel | ||
import com.terning.domain.entity.search.SearchResult | ||
import kotlinx.serialization.SerialName | ||
import kotlinx.serialization.Serializable | ||
|
||
|
@@ -35,9 +35,9 @@ data class SearchResultResponseDto( | |
val deadline: String, | ||
) | ||
|
||
fun toSearchResultEntity(): List<SearchResultModel> { | ||
fun toSearchResultEntity(): List<SearchResult> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이거 매퍼 파일 만들어주세요! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 헉쓰!!~! 이게 검색 뷰 여서 아직 수정하지 않았던 건데 SearchResult는 왜 수정했을까요,,,,,,? ㅜㅜ 여기서 한 번에 하겠습니다 |
||
return announcements.map { | ||
SearchResultModel( | ||
SearchResult( | ||
internshipAnnouncementId = it.internshipAnnouncementId, | ||
title = it.title, | ||
dDay = it.dDay, | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.terning.data.mapper.search | ||
|
||
import com.terning.data.dto.response.SearchAnnouncementResponseDto | ||
import com.terning.domain.entity.search.SearchAnnouncement | ||
|
||
fun SearchAnnouncementResponseDto.toSearchAnnouncementList(): List<SearchAnnouncement> { | ||
return announcements.map { | ||
SearchAnnouncement( | ||
announcementId = it.internshipAnnouncementId, | ||
companyImage = it.companyImage, | ||
title = it.title, | ||
) | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
package com.terning.domain.repository | ||
|
||
import com.terning.domain.entity.response.SearchResultModel | ||
import com.terning.domain.entity.response.InternshipAnnouncementModel | ||
import com.terning.domain.entity.search.SearchResult | ||
import com.terning.domain.entity.search.SearchAnnouncement | ||
|
||
interface SearchRepository { | ||
suspend fun getSearchList( | ||
query: String, | ||
sortBy: String, | ||
page: Int, | ||
size: Int, | ||
): Result<List<SearchResultModel>> | ||
suspend fun getSearchViewsList(): Result<List<InternshipAnnouncementModel>> | ||
suspend fun getSearchScrapsList(): Result<List<InternshipAnnouncementModel>> | ||
): Result<List<SearchResult>> | ||
suspend fun getSearchViewsList(): Result<List<SearchAnnouncement>> | ||
suspend fun getSearchScrapsList(): Result<List<SearchAnnouncement>> | ||
} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NavHostController는 SearchRoute까지 호이스팅하거나 유빈이 코드처럼 아예 Navigation 파일로 호이스팅하는게 좋을 것 같아요!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네엡 감사합니당~!!! 바로 수정해볼게욤 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ import com.terning.core.designsystem.theme.Grey100 | |
import com.terning.core.designsystem.theme.TerningTheme | ||
import com.terning.core.extension.noRippleClickable | ||
import com.terning.core.state.UiState | ||
import com.terning.domain.entity.response.InternshipAnnouncementModel | ||
import com.terning.domain.entity.search.SearchAnnouncement | ||
import com.terning.feature.R | ||
import com.terning.feature.search.search.component.ImageSlider | ||
import com.terning.feature.search.search.component.InternListType | ||
|
@@ -62,12 +62,12 @@ fun SearchRoute( | |
} | ||
|
||
val searchViewsList = when (viewState.searchViewsList) { | ||
is UiState.Success -> (viewState.searchViewsList as UiState.Success<List<InternshipAnnouncementModel>>).data | ||
is UiState.Success -> (viewState.searchViewsList as UiState.Success<List<SearchAnnouncement>>).data | ||
else -> emptyList() | ||
} | ||
|
||
val searchScrapsList = when (scrapState.searchScrapsList) { | ||
is UiState.Success -> (scrapState.searchScrapsList as UiState.Success<List<InternshipAnnouncementModel>>).data | ||
is UiState.Success -> (scrapState.searchScrapsList as UiState.Success<List<SearchAnnouncement>>).data | ||
else -> emptyList() | ||
} | ||
|
||
|
@@ -82,8 +82,8 @@ fun SearchRoute( | |
fun SearchScreen( | ||
modifier: Modifier = Modifier, | ||
navController: NavHostController, | ||
searchViewsList: List<InternshipAnnouncementModel>, | ||
searchScrapsList: List<InternshipAnnouncementModel>, | ||
searchViewsList: List<SearchAnnouncement>, | ||
searchScrapsList: List<SearchAnnouncement>, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이렇게 List를 선언하여 컴포저블에 넘겨도 안바뀌는 변수로 취급하지 않아 리컴포지션의 대상이 된다고 하더라고요,, 근데 만약 실시간으로 아이템이 추가돼야 하는 리스트의 경우에 Immutable을 사용해도 되는지는 몰루겠네요ㅎㅎ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 헉스 소중한 정보 공유 감사감사감사하비다 ㅡㅡ,,.! 해당 모델은 스크랩 많은 뷰 / 조회수 많은 뷰 공고 모델이라서, 뷰에 진입했을 때 기준으로 많이 띄우면 될 것 같고 실시간으로 아이템이 추가되는 건 아니라 Immutable 사용해보겠습ㄴ닷! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오!!! 좋은 정보 감사합니다...!!!! |
||
) { | ||
val images = listOf( | ||
R.drawable.img_ad_1, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package com.terning.feature.search.search.model | ||
|
||
import com.terning.domain.entity.response.InternshipAnnouncementModel | ||
import com.terning.domain.entity.search.SearchAnnouncement | ||
import com.terning.core.state.UiState | ||
|
||
data class SearchScrapsListState( | ||
var searchScrapsList: UiState<List<InternshipAnnouncementModel>> = UiState.Loading, | ||
var searchScrapsList: UiState<List<SearchAnnouncement>> = UiState.Loading, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package com.terning.feature.search.search.model | ||
|
||
import com.terning.domain.entity.response.InternshipAnnouncementModel | ||
import com.terning.domain.entity.search.SearchAnnouncement | ||
import com.terning.core.state.UiState | ||
|
||
data class SearchViewsListState( | ||
var searchViewsList: UiState<List<InternshipAnnouncementModel>> = UiState.Loading, | ||
var searchViewsList: UiState<List<SearchAnnouncement>> = UiState.Loading, | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
package com.terning.feature.search.searchprocess.models | ||
|
||
import com.terning.core.state.UiState | ||
import com.terning.domain.entity.response.SearchResultModel | ||
import com.terning.domain.entity.search.SearchResult | ||
|
||
data class SearchResultState( | ||
var searchListState: UiState<List<SearchResultModel>> = UiState.Loading, | ||
var searchListState: UiState<List<SearchResult>> = UiState.Loading, | ||
) |
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.
요거 지금 사용되는 내용이 아니라면 삭제해주면 좋을 것 같아요!!
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.
섬세하시닷!~