Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
4c5a7cc6
Commit
4c5a7cc6
authored
Nov 19, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapping function refactorign
parent
5809bb86
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
+7
-4
FeedsRepository.kt
...nto/visual/roompark/data/data_provider/FeedsRepository.kt
+6
-3
feeds.kt
...in/java/com/biganto/visual/roompark/domain/model/feeds.kt
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/FeedsRepository.kt
View file @
4c5a7cc6
...
@@ -4,7 +4,10 @@ import com.biganto.visual.roompark.data.repository.api.IRoomParkApi
...
@@ -4,7 +4,10 @@ import com.biganto.visual.roompark.data.repository.api.IRoomParkApi
import
com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.db.IDb
import
com.biganto.visual.roompark.data.repository.mapper.fromRaw
import
com.biganto.visual.roompark.data.repository.mapper.fromRaw
import
com.biganto.visual.roompark.domain.contract.FeedsContract
import
com.biganto.visual.roompark.domain.contract.FeedsContract
import
com.biganto.visual.roompark.domain.model.*
import
com.biganto.visual.roompark.domain.model.ArticlesPreviewModel
import
com.biganto.visual.roompark.domain.model.FeedModel
import
com.biganto.visual.roompark.domain.model.FeedsHeaderModel
import
com.biganto.visual.roompark.domain.model.fromEntity
import
io.reactivex.Observable
import
io.reactivex.Observable
import
io.reactivex.Single
import
io.reactivex.Single
import
io.reactivex.schedulers.Schedulers
import
io.reactivex.schedulers.Schedulers
...
@@ -51,9 +54,9 @@ class FeedsContractModule @Inject constructor(
...
@@ -51,9 +54,9 @@ class FeedsContractModule @Inject constructor(
.
toObservable
()
.
toObservable
()
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
fun
getZone
s
(
userToken
:
String
):
Observable
<
List
<
FeedModel
>>
=
fun
fetchAllFeed
s
(
userToken
:
String
):
Observable
<
List
<
FeedModel
>>
=
Observable
.
mergeDelayError
(
Observable
.
mergeDelayError
(
arrayListOf
(
fetchFeedsApi
(
userToken
),
fetchFeedsDb
)
arrayListOf
(
fetchFeedsApi
(
userToken
),
fetchFeedsDb
)
).
map
{
fromEntity
(
it
)
{
ent
->
fromEntity2
(
ent
)}
}
).
map
{
fromEntity
(
it
,
::
fromEntity
)
}
}
}
app/src/main/java/com/biganto/visual/roompark/domain/model/feeds.kt
View file @
4c5a7cc6
...
@@ -33,7 +33,7 @@ data class ArticleModel(
...
@@ -33,7 +33,7 @@ data class ArticleModel(
val
isRead
:
Boolean
val
isRead
:
Boolean
)
)
fun
fromEntity
2
(
entity
:
FeedEntity
):
FeedModel
=
FeedModel
(
fun
fromEntity
(
entity
:
FeedEntity
):
FeedModel
=
FeedModel
(
feedId
=
entity
.
id
,
feedId
=
entity
.
id
,
title
=
entity
.
title
,
title
=
entity
.
title
,
alias
=
entity
.
alias
alias
=
entity
.
alias
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment