File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
data/src/main/java/com/stop/data/local
presentation/src/main/java/com/stop/ui/route Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import kotlinx.coroutines.flow.Flow
11
11
interface RecentPlaceSearchDao {
12
12
13
13
@Insert(onConflict = OnConflictStrategy .REPLACE )
14
- suspend fun insertRecentPlaceSearchEntity (recentPlaceSearchEntity : RecentPlaceSearchEntity )
14
+ suspend fun insertRecentPlaceSearchEntity (recentPlaceSearchEntity : RecentPlaceSearchEntity ) : Long
15
15
16
16
@Query(" SELECT * FROM RecentPlaceSearchEntity ORDER BY id DESC" )
17
17
fun getAllRecentPlaceSearchEntity (): Flow <List <RecentPlaceSearchEntity >>
Original file line number Diff line number Diff line change 1
1
package com.stop.data.local.model
2
2
3
3
import androidx.room.Entity
4
+ import androidx.room.Index
4
5
import androidx.room.PrimaryKey
5
6
import com.stop.data.model.nearplace.PlaceRepositoryItem
6
7
7
- @Entity
8
+ @Entity(indices = [ Index (value = [ " name " ], unique = true )])
8
9
data class RecentPlaceSearchEntity (
9
- @PrimaryKey(autoGenerate = true )
10
- val id : Int? = null ,
11
10
val name : String ,
12
11
val radius : String ,
13
12
val fullAddressRoad : String ,
14
13
val centerLat : Double ,
15
- val centerLon : Double
14
+ val centerLon : Double ,
15
+ @PrimaryKey(autoGenerate = true )
16
+ val id : Long = 0 ,
16
17
) {
17
18
18
19
fun toRepositoryModel () = PlaceRepositoryItem (
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ class RouteFragment : Fragment() {
94
94
95
95
routeViewModel.lastTimeResponse.observe(viewLifecycleOwner) { event ->
96
96
event.getContentIfNotHandled()?.let { response ->
97
- clickRouteViewModel .lastTimes = response
97
+ routeViewModel .lastTimes = response
98
98
binding.root.findNavController().navigate(R .id.action_routeFragment_to_routeDetailFragment)
99
99
}
100
100
}
You can’t perform that action at this time.
0 commit comments