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
5fb56b38
Commit
5fb56b38
authored
Mar 18, 2020
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prove isRead flag for article
parent
b22a6d40
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
28 additions
and
1 deletion
+28
-1
gradle.xml
.idea/gradle.xml
+2
-0
FeedsRepository.kt
...nto/visual/roompark/data/data_provider/FeedsRepository.kt
+6
-0
IDb.kt
...ava/com/biganto/visual/roompark/data/repository/db/IDb.kt
+2
-0
RequeryRepository.kt
.../roompark/data/repository/db/requrey/RequeryRepository.kt
+9
-1
Article.kt
...sual/roompark/data/repository/db/requrey/model/Article.kt
+3
-0
Deal.kt
.../visual/roompark/data/repository/db/requrey/model/Deal.kt
+2
-0
FeedsContract.kt
.../biganto/visual/roompark/domain/contract/FeedsContract.kt
+2
-0
feedUseCase.kt
...om/biganto/visual/roompark/domain/use_case/feedUseCase.kt
+2
-0
No files found.
.idea/gradle.xml
View file @
5fb56b38
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"GradleMigrationSettings"
migrationVersion=
"1"
/>
<component
name=
"GradleSettings"
>
<option
name=
"linkedExternalProjectsSettings"
>
<GradleProjectSettings>
<option
name=
"delegatedBuild"
value=
"false"
/>
<option
name=
"testRunner"
value=
"PLATFORM"
/>
<option
name=
"distributionType"
value=
"DEFAULT_WRAPPED"
/>
<option
name=
"externalProjectPath"
value=
"$PROJECT_DIR$"
/>
...
...
app/src/main/java/com/biganto/visual/roompark/data/data_provider/FeedsRepository.kt
View file @
5fb56b38
...
...
@@ -10,6 +10,7 @@ import com.biganto.visual.roompark.domain.model.ArticleModel
import
com.biganto.visual.roompark.domain.model.ArticlesPreviewModel
import
com.biganto.visual.roompark.domain.model.FeedModel
import
com.biganto.visual.roompark.domain.model.fromEntity
import
io.reactivex.Completable
import
io.reactivex.Observable
import
io.reactivex.schedulers.Schedulers
import
timber.log.Timber
...
...
@@ -33,6 +34,7 @@ class FeedsContractModule @Inject constructor(
override
fun
fetchFeedObservable
(
feedAlias
:
String
):
Observable
<
ArticlesPreviewModel
>
=
fetchArticles
(
feedAlias
)
override
fun
fetchFeedObservable
(
feedAlias
:
String
,
pageSize
:
Int
,
startIndex
:
Int
)
:
Observable
<
ArticlesPreviewModel
>
=
fetchArticles
(
feedAlias
,
pageSize
,
startIndex
)
...
...
@@ -123,5 +125,9 @@ class FeedsContractModule @Inject constructor(
arrayListOf
(
fetchArticleDb
(
articleId
),
fetchArticleApi
(
articleId
))
).
map
{
fromEntity
(
it
,
true
)
}
override
fun
articleRead
(
articleId
:
Int
):
Completable
=
db
.
setArticleReadState
(
articleId
,
true
)
}
app/src/main/java/com/biganto/visual/roompark/data/repository/db/IDb.kt
View file @
5fb56b38
package
com.biganto.visual.roompark.data.repository.db
import
com.biganto.visual.roompark.data.repository.db.requrey.model.*
import
io.reactivex.Completable
import
io.reactivex.Observable
import
io.reactivex.Single
import
io.requery.Persistable
...
...
@@ -31,4 +32,5 @@ interface IDb {
fun
getEstate
(
estateId
:
Int
):
Observable
<
EstateEntity
>
fun
upsertEstate
(
entity
:
EstateEntity
)
fun
fetchEstateByNumber
(
building
:
Int
,
number
:
String
):
ReactiveResult
<
EstateEntity
>
fun
setArticleReadState
(
id
:
Int
,
state
:
Boolean
):
Completable
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/RequeryRepository.kt
View file @
5fb56b38
...
...
@@ -157,4 +157,12 @@ class RequeryRepository @Inject constructor(
.
where
(
EstateEntity
.
USER_ID
.
eq
(
uuid
))
.
and
(
EstateEntity
.
FAVORITE
.
eq
(
true
))
.
get
().
observable
()
}
\ No newline at end of file
override
fun
setArticleReadState
(
id
:
Int
,
state
:
Boolean
)
=
store
.
update
(
ArticleEntity
::
class
)
.
set
(
ArticleEntity
.
ANNOUNCE
,
""
)
.
where
(
ArticleEntity
.
ID
.
eq
(
id
))
.
get
()
.
single
()
.
ignoreElement
()
}
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/Article.kt
View file @
5fb56b38
...
...
@@ -27,4 +27,7 @@ interface Article : Persistable {
val
feed
:
Feed
?
@get
:
Convert
(
TitledPhotoListConverter
::
class
)
var
photo
:
List
<
TitledPhoto
>?
val
read
:
Boolean
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/Deal.kt
View file @
5fb56b38
...
...
@@ -25,4 +25,6 @@ interface Deal : Persistable {
@get
:
ForeignKey
(
references
=
User
::
class
)
@get
:
ManyToOne
(
cascade
=
[
CascadeAction
.
NONE
])
var
user
:
User
?
val
read
:
Boolean
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/contract/FeedsContract.kt
View file @
5fb56b38
...
...
@@ -3,6 +3,7 @@ package com.biganto.visual.roompark.domain.contract
import
com.biganto.visual.roompark.domain.model.ArticleModel
import
com.biganto.visual.roompark.domain.model.ArticlesPreviewModel
import
com.biganto.visual.roompark.domain.model.FeedModel
import
io.reactivex.Completable
import
io.reactivex.Observable
/**
...
...
@@ -20,4 +21,5 @@ interface FeedsContract{
):
Observable
<
ArticlesPreviewModel
>
fun
fetchFeedObservable
(
feedAlias
:
String
):
Observable
<
ArticlesPreviewModel
>
fun
articleRead
(
articleId
:
Int
):
Completable
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/domain/use_case/feedUseCase.kt
View file @
5fb56b38
...
...
@@ -21,4 +21,6 @@ class FeedUseCase @Inject constructor(
fun
getArticle
(
articleId
:
Int
)
=
contract
.
getArticle
(
articleId
)
fun
setRead
(
articleId
:
Int
)
=
contract
.
articleRead
(
articleId
)
}
\ No newline at end of file
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