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
4168f8e7
Commit
4168f8e7
authored
Apr 03, 2020
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix api error param
parent
3f7f30b5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
5 deletions
+13
-5
TourChooserDialogController.kt
...uctor/dialogs/tour_chooser/TourChooserDialogController.kt
+1
-1
IBigantoMobileApi.kt
...roompark/data/repository/api/biganto/IBigantoMobileApi.kt
+1
-1
toures.kt
...ava/com/biganto/visual/roompark/domain/use_case/toures.kt
+11
-3
No files found.
app/src/main/java/com/biganto/visual/roompark/conductor/dialogs/tour_chooser/TourChooserDialogController.kt
View file @
4168f8e7
...
@@ -75,7 +75,7 @@ class ChooseTourDialogController : Controller {
...
@@ -75,7 +75,7 @@ class ChooseTourDialogController : Controller {
// )
// )
})
})
view
.
findViewById
<
View
>(
R
.
id
.
c
ancel
_button
).
setOnClickListener
{
handleBack
()
}
view
.
findViewById
<
View
>(
R
.
id
.
c
lose_current
_button
).
setOnClickListener
{
handleBack
()
}
return
view
return
view
}
}
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/biganto/IBigantoMobileApi.kt
View file @
4168f8e7
...
@@ -146,7 +146,7 @@ interface IBigantoMobileApi {
...
@@ -146,7 +146,7 @@ interface IBigantoMobileApi {
@Query
(
CLIENT_VERSION_PARAM
)
clientVersion
:
String
=
DEFAULT_CLIENT_VERSION
,
@Query
(
CLIENT_VERSION_PARAM
)
clientVersion
:
String
=
DEFAULT_CLIENT_VERSION
,
@Query
(
API_VERSION_PARAM
)
apiVersion
:
String
=
DEFAULT_API_VERSION
,
@Query
(
API_VERSION_PARAM
)
apiVersion
:
String
=
DEFAULT_API_VERSION
,
@Query
(
LANG_PARAM
)
languageCode
:
String
=
Locale
.
getDefault
().
language
,
@Query
(
LANG_PARAM
)
languageCode
:
String
=
Locale
.
getDefault
().
language
,
@Query
(
OFFER_GET_TOURS_
METHO
D
)
offerId
:
Int
@Query
(
OFFER_GET_TOURS_
I
D
)
offerId
:
Int
):
Observable
<
Response
<
OfferTours
>>
):
Observable
<
Response
<
OfferTours
>>
@Streaming
@Streaming
...
...
app/src/main/java/com/biganto/visual/roompark/domain/use_case/toures.kt
View file @
4168f8e7
...
@@ -97,15 +97,21 @@ class TourPreviewsUseCase @Inject constructor(
...
@@ -97,15 +97,21 @@ class TourPreviewsUseCase @Inject constructor(
private
fun
fetchDbTourList
(
estateId
:
Int
)
=
private
fun
fetchDbTourList
(
estateId
:
Int
)
=
db
.
getEstateTourPreviews
(
estateId
)
db
.
getEstateTourPreviews
(
estateId
)
.
filter
{
!
it
.
isNullOrEmpty
()
}
private
fun
fetchApiTourList
(
multitourId
:
Int
,
estateId
:
Int
)
=
private
fun
fetchApiTourList
(
multitourId
:
Int
,
estateId
:
Int
)
=
auth
.
currentUser
().
flatMap
{
user
->
auth
.
currentUser
()
.
doOnNext
{
Timber
.
d
(
"user on next: $it"
)
}
.
map
{
it
.
targetResolution
}
.
flatMap
{
res
->
Timber
.
d
(
"user: $res"
)
api
.
getOfferTours
(
multitourId
)
api
.
getOfferTours
(
multitourId
)
.
doOnError
{
Timber
.
e
(
it
)
}
.
map
{
.
map
{
mergeRaw
(
it
,
TourRemoteRequestModel
(
mergeRaw
(
it
,
TourRemoteRequestModel
(
estateId
,
estateId
,
api
.
provideHttpUrl
().
toString
(),
api
.
provideHttpUrl
().
toString
(),
user
.
targetResolution
res
)
)
)
)
}
}
...
@@ -117,8 +123,9 @@ class TourPreviewsUseCase @Inject constructor(
...
@@ -117,8 +123,9 @@ class TourPreviewsUseCase @Inject constructor(
Observable
.
mergeDelayError
(
Observable
.
mergeDelayError
(
arrayListOf
(
fetchDbTourList
(
parent
),
fetchApiTourList
(
multitourId
,
parent
))
arrayListOf
(
fetchDbTourList
(
parent
),
fetchApiTourList
(
multitourId
,
parent
))
)
)
.
map
{
it
}
.
doOnError
{
Timber
.
e
(
it
)
}
.
map
(
::
fromEntity
)
.
map
(
::
fromEntity
)
.
subscribeOn
(
Schedulers
.
io
())
private
fun
mergeRaw
(
raw
:
List
<
TourPreviewRaw
>,
requestRequestModel
:
TourRemoteRequestModel
)
=
private
fun
mergeRaw
(
raw
:
List
<
TourPreviewRaw
>,
requestRequestModel
:
TourRemoteRequestModel
)
=
...
@@ -126,6 +133,7 @@ class TourPreviewsUseCase @Inject constructor(
...
@@ -126,6 +133,7 @@ class TourPreviewsUseCase @Inject constructor(
private
fun
mergeRaw
(
raw
:
TourPreviewRaw
,
requestRequestModel
:
TourRemoteRequestModel
)
private
fun
mergeRaw
(
raw
:
TourPreviewRaw
,
requestRequestModel
:
TourRemoteRequestModel
)
:
TourPreviewEntity
{
:
TourPreviewEntity
{
Timber
.
d
(
"got raw: $raw"
)
val
entity
=
db
.
getTourPreview
(
raw
.
id
.
toString
()).
firstOrNull
()
val
entity
=
db
.
getTourPreview
(
raw
.
id
.
toString
()).
firstOrNull
()
?:
return
fromRaw
(
raw
?:
return
fromRaw
(
raw
,
requestRequestModel
.
estateId
,
requestRequestModel
.
estateId
...
...
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