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
00b2983d
Commit
00b2983d
authored
Nov 21, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove alias from articles as key
parent
54b1a51a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
8 deletions
+5
-8
FeedsRepository.kt
...nto/visual/roompark/data/data_provider/FeedsRepository.kt
+1
-1
Feed.kt
.../visual/roompark/data/repository/db/requrey/model/Feed.kt
+1
-2
raw2entity.kt
...anto/visual/roompark/data/repository/mapper/raw2entity.kt
+3
-5
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/FeedsRepository.kt
View file @
00b2983d
...
@@ -54,7 +54,7 @@ class FeedsContractModule @Inject constructor(
...
@@ -54,7 +54,7 @@ class FeedsContractModule @Inject constructor(
return
api
.
getArticlesPage
(
feed
.
alias
,
11
,
1
)
return
api
.
getArticlesPage
(
feed
.
alias
,
11
,
1
)
.
doOnNext
{
Timber
.
d
(
"raw0 $it"
)
}
.
doOnNext
{
Timber
.
d
(
"raw0 $it"
)
}
.
map
{
it
.
items
}
.
map
{
it
.
items
}
.
map
{
fromRaw
(
it
,
feedId
,
feed
.
alias
)
}
.
map
{
fromRaw
(
it
,
feedId
)
}
.
doOnNext
(
db
::
blockingUpsert
)
.
doOnNext
(
db
::
blockingUpsert
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/Feed.kt
View file @
00b2983d
...
@@ -13,9 +13,8 @@ interface Feed : Persistable {
...
@@ -13,9 +13,8 @@ interface Feed : Persistable {
@get
:
Key
@get
:
Key
val
id
:
Int
val
id
:
Int
val
title
:
String
val
title
:
String
@get
:
Key
val
alias
:
String
val
alias
:
String
@get
:
JunctionTable
(
name
=
"FeedArticlesRule"
)
@get
:
JunctionTable
(
name
=
"FeedArticlesRule"
)
@get
:
OneToMany
(
cascade
=
arrayOf
(
CascadeAction
.
DELETE
)
)
@get
:
OneToMany
(
cascade
=
[
CascadeAction
.
DELETE
]
)
val
articles
:
Set
<
Article
>?
val
articles
:
Set
<
Article
>?
}
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/repository/mapper/raw2entity.kt
View file @
00b2983d
...
@@ -48,7 +48,7 @@ fun fromRaw(raw:ArticleRaw) : ArticleEntity {
...
@@ -48,7 +48,7 @@ fun fromRaw(raw:ArticleRaw) : ArticleEntity {
}
}
fun
fromRaw
(
raw
:
NewsArticleRaw
,
feedId
:
Int
,
feedAlias
:
String
):
ArticleEntity
{
fun
fromRaw
(
raw
:
NewsArticleRaw
,
feedId
:
Int
):
ArticleEntity
{
val
entity
=
ArticleEntity
()
val
entity
=
ArticleEntity
()
entity
.
setId
(
raw
.
id
)
entity
.
setId
(
raw
.
id
)
entity
.
setPreview
(
"https://room-park.ru${raw.preview}"
)
entity
.
setPreview
(
"https://room-park.ru${raw.preview}"
)
...
@@ -64,9 +64,7 @@ fun fromRaw(raw:NewsArticleRaw,feedId:Int,feedAlias:String):ArticleEntity{
...
@@ -64,9 +64,7 @@ fun fromRaw(raw:NewsArticleRaw,feedId:Int,feedAlias:String):ArticleEntity{
fun
fromRaw
(
raw
:
List
<
FeedRaw
>):
List
<
FeedEntity
>
=
List
(
raw
.
size
)
{
index
->
fromRaw
(
raw
[
index
])
}
fun
fromRaw
(
raw
:
List
<
FeedRaw
>):
List
<
FeedEntity
>
=
List
(
raw
.
size
)
{
index
->
fromRaw
(
raw
[
index
])
}
fun
fromRaw
(
raw
:
List
<
NewsArticleRaw
>,
feedId
:
Int
,
feedAlias
:
String
):
List
<
ArticleEntity
>
=
fun
fromRaw
(
raw
:
List
<
NewsArticleRaw
>,
feedId
:
Int
):
List
<
ArticleEntity
>
=
List
(
raw
.
size
)
{
index
->
fromRaw
(
raw
[
index
],
feedId
,
feedAlias
)
}
List
(
raw
.
size
)
{
index
->
fromRaw
(
raw
[
index
],
feedId
)
}
val
calcTargetResolution
=
max
(
display
.
widthPixels
,
display
.
heightPixels
)
val
calcTargetResolution
=
max
(
display
.
widthPixels
,
display
.
heightPixels
)
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