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
241cf0ba
Commit
241cf0ba
authored
Dec 03, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
actualize raw models
parent
7fcc5468
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
31 deletions
+25
-31
response.kt
...ual/roompark/data/repository/api/retrofit/raw/response.kt
+14
-1
Article.kt
...sual/roompark/data/repository/db/requrey/model/Article.kt
+1
-1
Feed.kt
.../visual/roompark/data/repository/db/requrey/model/Feed.kt
+1
-3
raw2entity.kt
...anto/visual/roompark/data/repository/mapper/raw2entity.kt
+8
-25
ContextModule.kt
...va/com/biganto/visual/roompark/di/dagger/ContextModule.kt
+1
-1
No files found.
app/src/main/java/com/biganto/visual/roompark/data/repository/api/retrofit/raw/response.kt
View file @
241cf0ba
...
...
@@ -74,7 +74,6 @@ data class EstateRoomRaw(
)
data class
FeedRaw
(
val
id
:
Int
,
val
alias
:
String
,
val
title
:
String
)
...
...
@@ -99,6 +98,8 @@ data class ArticleRaw(
val
id
:
Int
,
val
published
:
Date
,
val
title
:
String
,
val
announce
:
String
,
val
preview
:
String
?,
val
body
:
String
,
val
feed_alias
:
String
,
val
photo
:
List
<
NewsPhotoRaw
>?
...
...
@@ -157,3 +158,15 @@ data class AppVersionRaw(
val
critical
:
Boolean
,
val
errors
:
List
<
ErrorRaw
>?
)
data class
WebCamRaw
(
val
id
:
Int
,
val
title
:
String
,
val
Streams
:
List
<
StreamRaw
>
)
data class
StreamRaw
(
val
res_name
:
String
,
val
hls
:
String
,
val
rtmp
:
String
)
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/Article.kt
View file @
241cf0ba
...
...
@@ -22,7 +22,7 @@ interface Article : Persistable {
val
preview
:
String
?
@get
:
Nullable
val
body
:
String
?
@get
:
ForeignKey
(
references
=
Feed
::
class
,
referencedColumn
=
"
id
"
)
@get
:
ForeignKey
(
references
=
Feed
::
class
,
referencedColumn
=
"
alias
"
)
@get
:
ManyToOne
(
cascade
=
[
CascadeAction
.
NONE
])
val
feed
:
Feed
?
@get
:
Convert
(
TitledPhotoListConverter
::
class
)
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/model/Feed.kt
View file @
241cf0ba
...
...
@@ -9,11 +9,9 @@ import io.requery.*
@Entity
interface
Feed
:
Persistable
{
@get
:
Key
val
id
:
Int
val
title
:
String
val
alias
:
String
val
title
:
String
@get
:
JunctionTable
(
name
=
"FeedArticlesRule"
)
@get
:
OneToMany
(
cascade
=
[
CascadeAction
.
DELETE
])
val
articles
:
Set
<
Article
>?
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/mapper/raw2entity.kt
View file @
241cf0ba
...
...
@@ -27,7 +27,6 @@ fun fromRaw(raw: AuthRaw) : UserEntity {
fun
fromRaw
(
raw
:
FeedRaw
)
:
FeedEntity
{
val
entity
=
FeedEntity
()
entity
.
setId
(
raw
.
id
)
entity
.
setTitle
(
raw
.
title
)
entity
.
setAlias
(
raw
.
alias
)
return
entity
...
...
@@ -36,9 +35,12 @@ fun fromRaw(raw:FeedRaw) : FeedEntity {
fun
fromRaw
(
raw
:
ArticleRaw
)
:
ArticleEntity
{
val
entity
=
ArticleEntity
()
entity
.
setId
(
raw
.
id
)
entity
.
setPublished
(
raw
.
published
)
entity
.
setTitle
(
raw
.
title
)
entity
.
setBody
(
raw
.
body
)
entity
.
setPreview
(
raw
.
feed_alias
)
entity
.
setAnnounce
(
raw
.
announce
)
entity
.
setPreview
(
raw
.
preview
)
raw
.
photo
?.
let
{
entity
.
photo
=
fromRawList
(
it
,
::
fromRaw
)}
val
feed
=
FeedEntity
()
feed
.
setAlias
(
raw
.
feed_alias
)
entity
.
setFeed
(
feed
)
...
...
@@ -47,7 +49,7 @@ fun fromRaw(raw:ArticleRaw) : ArticleEntity {
}
fun
fromRaw
(
raw
:
NewsArticleRaw
,
feed
Id
:
Int
):
ArticleEntity
{
fun
fromRaw
(
raw
:
NewsArticleRaw
,
feed
Alias
:
String
):
ArticleEntity
{
val
entity
=
ArticleEntity
()
entity
.
setId
(
raw
.
id
)
entity
.
setPreview
(
raw
.
preview
)
...
...
@@ -55,31 +57,12 @@ fun fromRaw(raw:NewsArticleRaw,feedId:Int):ArticleEntity{
entity
.
setPublished
(
raw
.
published
)
entity
.
setTitle
(
raw
.
title
)
val
feed
=
FeedEntity
()
feed
.
setId
(
feedId
)
// feed.setAlias(feedAlias)
feed
.
setAlias
(
feedAlias
)
entity
.
setFeed
(
feed
)
return
entity
}
fun
fromRaw
(
raw
:
ArticleRaw
,
feedId
:
Int
):
ArticleEntity
{
val
entity
=
ArticleEntity
()
entity
.
setId
(
raw
.
id
)
entity
.
setPublished
(
raw
.
published
)
entity
.
setTitle
(
raw
.
title
)
entity
.
setBody
(
raw
.
body
)
raw
.
photo
?.
let
{
entity
.
photo
=
fromRawList
(
it
,
::
fromRaw
)
}
val
feed
=
FeedEntity
()
feed
.
setId
(
feedId
)
// feed.setAlias(raw.feed_alias)
entity
.
setFeed
(
feed
)
return
entity
}
fun
fromRaw
(
raw
:
NewsPhotoRaw
):
TitledPhoto
{
return
TitledPhoto
(
raw
.
title
,
raw
.
url
)
}
...
...
@@ -99,7 +82,7 @@ fun fromRaw(raw:ImageAlbumRaw) : ImageAlbumEntity {
fun
<
E
,
M
>
fromRawList
(
raw
:
List
<
E
>,
block
:(
E
)->
M
):
List
<
M
>
=
List
(
raw
.
size
)
{
index
->
block
(
raw
[
index
])
}
fun
fromRaw
(
raw
:
List
<
NewsArticleRaw
>,
feed
Id
:
Int
):
List
<
ArticleEntity
>
=
List
(
raw
.
size
)
{
index
->
fromRaw
(
raw
[
index
],
feed
Id
)
}
fun
fromRaw
(
raw
:
List
<
NewsArticleRaw
>,
feed
Alias
:
String
):
List
<
ArticleEntity
>
=
List
(
raw
.
size
)
{
index
->
fromRaw
(
raw
[
index
],
feed
Alias
)
}
val
calcTargetResolution
=
max
(
display
.
widthPixels
,
display
.
heightPixels
)
app/src/main/java/com/biganto/visual/roompark/di/dagger/ContextModule.kt
View file @
241cf0ba
...
...
@@ -21,7 +21,7 @@ const val ESTATES_CACHE_LIMIT_SECONDS_INACTIVE = 200L
const
val
FILES_CACHE_LIMIT_SIZE
=
10000
const
val
FILES_CACHE_LIMIT_SECONDS_INACTIVE
=
60L
const
val
DATABASE_VERSION
=
7
const
val
DATABASE_VERSION
=
8
@Module
abstract
class
AppModule
{
...
...
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