-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#91 BaseNavArgs개선(NavArgs로 가능한 거의 대부분의 타입 호환)
- Loading branch information
Showing
27 changed files
with
232 additions
and
130 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
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
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
9 changes: 9 additions & 0 deletions
9
.../src/main/java/com/android/mediproject/core/database/searchhistory/SearchHistoryMapper.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.android.mediproject.core.database.searchhistory | ||
|
||
import java.time.LocalDateTime | ||
|
||
fun SearchHistoryDto.toSearchHistoryItemDto(): com.android.mediproject.core.model.search.local.SearchHistoryItemDto { | ||
return com.android.mediproject.core.model.search.local.SearchHistoryItemDto( | ||
id = id, query = query, searchedAt = LocalDateTime.parse(this.searchDateTime) | ||
) | ||
} |
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
24 changes: 24 additions & 0 deletions
24
core/domain/src/main/java/com/android/mediproject/core/domain/SearchHistoryUseCase.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.android.mediproject.core.domain | ||
|
||
import com.android.mediproject.core.data.search.SearchHistoryRepository | ||
import com.android.mediproject.core.database.searchhistory.toSearchHistoryItemDto | ||
import kotlinx.coroutines.flow.map | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
class SearchHistoryUseCase @Inject constructor( | ||
private val searchHistoryRepository: SearchHistoryRepository | ||
) { | ||
suspend fun insertSearchHistory(query: String) = searchHistoryRepository.insertSearchHistory(query) | ||
|
||
suspend fun getSearchHistoryList(count: Int) = searchHistoryRepository.getSearchHistoryList(count).map { | ||
it.map { | ||
it.toSearchHistoryItemDto() | ||
} | ||
} | ||
|
||
suspend fun deleteSearchHistory(id: Long) = searchHistoryRepository.deleteSearchHistory(id) | ||
|
||
suspend fun deleteAllSearchHistory() = searchHistoryRepository.deleteAllSearchHistory() | ||
} |
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
...del/src/main/java/com/android/mediproject/core/model/search/local/SearchHistoryItemDto.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.android.mediproject.core.model.search.local | ||
|
||
import java.time.LocalDateTime | ||
|
||
data class SearchHistoryItemDto( | ||
val id: Long, | ||
val query: String, | ||
val searchedAt: LocalDateTime | ||
) |
12 changes: 12 additions & 0 deletions
12
...src/main/java/com/android/mediproject/core/model/searchmedicines/local/SearchQueryArgs.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,12 @@ | ||
package com.android.mediproject.core.model.searchmedicines.local | ||
|
||
import com.android.mediproject.core.model.local.navargs.BaseNavArgs | ||
|
||
/** | ||
* 검색어를 전달할 인자 | ||
* | ||
* @property query 검색어 | ||
*/ | ||
data class SearchQueryArgs( | ||
val query: String = "" | ||
) : BaseNavArgs(SearchQueryArgs::class.java.name) |
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.