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
450c1003
Commit
450c1003
authored
Jan 10, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plan cache
parent
55e0a43e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
14 deletions
+33
-14
EstateRepository.kt
...to/visual/roompark/data/data_provider/EstateRepository.kt
+33
-14
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/EstateRepository.kt
View file @
450c1003
...
...
@@ -122,20 +122,34 @@ class EstateRepository @Inject constructor(
,
walls
?:
false
,
electric
?:
false
)
.
map
{
val
sFile
=
FileModule
.
getDirectory
(
file
.
context
,
FileModule
.
FileDirectory
.
PlanTypeDir
(
val
sFile
=
getPlanFile
(
estateId
=
estateId
,
planId
=
planId
,
furniture
=
furniture
,
walls
=
walls
,
sizes
=
sizes
,
electric
=
electric
))
electric
=
electric
)
file
.
saveFileToDisk
(
sFile
,
it
)
sFile
.
path
}
.
subscribeOn
(
Schedulers
.
io
())
private
fun
getPlanFile
(
estateId
:
Int
,
planId
:
Int
,
furniture
:
Boolean
?
=
null
,
sizes
:
Boolean
?
=
null
,
walls
:
Boolean
?
=
null
,
electric
:
Boolean
?
=
null
)
=
FileModule
.
getDirectory
(
file
.
context
,
FileModule
.
FileDirectory
.
PlanTypeDir
(
estateId
=
estateId
,
planId
=
planId
,
furniture
=
furniture
,
walls
=
walls
,
sizes
=
sizes
,
electric
=
electric
))
override
fun
getEmptyPlan
(
estateId
:
Int
,
planId
:
Int
):
Observable
<
String
>
=
...
...
@@ -149,17 +163,22 @@ class EstateRepository @Inject constructor(
,
sizes
:
Boolean
?
,
walls
:
Boolean
?
,
electric
:
Boolean
?):
Observable
<
String
>
=
Observable
.
mergeDelayError
(
arrayListOf
(
getPlanApi
(
estateId
,
planId
,
furniture
,
sizes
,
walls
,
electric
)
Observable
.
fromCallable
{
getPlanFile
(
estateId
=
estateId
,
planId
=
planId
,
furniture
=
furniture
,
walls
=
walls
,
sizes
=
sizes
,
electric
=
electric
)
}.
switchMap
{
if
(
it
.
exists
())
Observable
.
just
(
it
.
path
)
else
getPlanApi
(
estateId
,
planId
,
furniture
,
sizes
,
walls
,
electric
)
)
}
// fun getPlanRequestString(estateId: Int
...
...
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