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
5b64fc34
Commit
5b64fc34
authored
Apr 03, 2020
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add multitour offers method
parent
db683550
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
2 deletions
+34
-2
BigantoRetrofitRepository.kt
.../data/repository/api/biganto/BigantoRetrofitRepository.kt
+11
-2
IBigantoApi.kt
...isual/roompark/data/repository/api/biganto/IBigantoApi.kt
+2
-0
IBigantoMobileApi.kt
...roompark/data/repository/api/biganto/IBigantoMobileApi.kt
+16
-0
RawData.kt
...isual/roompark/data/repository/api/biganto/raw/RawData.kt
+5
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/data/repository/api/biganto/BigantoRetrofitRepository.kt
View file @
5b64fc34
...
...
@@ -40,14 +40,14 @@ class BigantoRetrofitRepository(retrofit:Retrofit) : IBigantoApi{
override
fun
getTourMetaAsString
(
tour_id
:
String
):
Observable
<
String
>
=
api
.
getTourMetaAsString
(
ids
=
tour_id
)
.
map
{
it
.
toString
()
}
.
doOnError
{
Timber
.
e
(
it
)
}
.
doOnError
{
e
(
it
)
}
.
subscribeOn
(
Schedulers
.
io
())
override
fun
getTourFiles
(
tour_id
:
String
,
resolution
:
String
):
Observable
<
List
<
TourFilesDataRaw
>>
=
api
.
getTourFiles
(
ids
=
tour_id
,
resolution
=
resolution
)
.
compose
(
RetrofitResponseValidation
())
.
doOnError
{
Timber
.
e
(
it
)
}
.
doOnError
{
e
(
it
)
}
.
subscribeOn
(
Schedulers
.
io
())
...
...
@@ -55,6 +55,15 @@ class BigantoRetrofitRepository(retrofit:Retrofit) : IBigantoApi{
.
requestFile
(
headers
?:
HashMap
<
String
,
String
>(),
uri
)
.
compose
(
FlowableRetrofitResponseValidation
())
.
doOnError
(
::
e
)
override
fun
getOfferTours
(
multiTourId
:
Int
):
Observable
<
List
<
TourPreviewRaw
>>
=
api
.
getOfferTours
(
offerId
=
multiTourId
)
.
compose
(
RetrofitResponseValidation
())
.
map
{
it
.
data
[
multiTourId
]
?.
toList
()
?:
error
(
"No tours avaliable"
)}
.
doOnError
{
e
(
it
)
}
.
subscribeOn
(
Schedulers
.
io
())
}
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/biganto/IBigantoApi.kt
View file @
5b64fc34
...
...
@@ -23,4 +23,6 @@ interface IBigantoApi {
fun
getTourFiles
(
tour_id
:
String
,
resolution
:
String
):
Observable
<
List
<
TourFilesDataRaw
>>
fun
getAppVersion
():
Observable
<
AppVersionRaw
>
fun
getToursPreviewById
(
tourIds
:
List
<
String
>):
Observable
<
List
<
TourPreviewRaw
>>
fun
getOfferTours
(
multiTourId
:
Int
):
Observable
<
List
<
TourPreviewRaw
>>
}
\ No newline at end of file
app/src/main/java/com/biganto/visual/roompark/data/repository/api/biganto/IBigantoMobileApi.kt
View file @
5b64fc34
package
com.biganto.visual.roompark.data.repository.api.biganto
import
com.biganto.visual.roompark.data.repository.api.biganto.raw.AppVersionRaw
import
com.biganto.visual.roompark.data.repository.api.biganto.raw.OfferTours
import
com.biganto.visual.roompark.data.repository.api.biganto.raw.TourFilesDataRaw
import
com.biganto.visual.roompark.data.repository.api.biganto.raw.TourPreviewRaw
import
com.google.gson.JsonArray
...
...
@@ -92,6 +93,11 @@ interface IBigantoMobileApi {
const
val
GET_TOURS_FILES_ID
=
"id"
const
val
GET_TOURS_FILES_RESOLUTION
=
"resolution"
//endregion
//region offers.GetTours
const
val
OFFER_GET_TOURS_METHOD
=
"offers.getTours"
const
val
OFFER_GET_TOURS_ID
=
"id"
//endregion
}
@GET
(
"$API_URL$GET_TOURS_METHOD$DELIMITER"
)
...
...
@@ -133,6 +139,16 @@ interface IBigantoMobileApi {
):
Observable
<
Response
<
AppVersionRaw
>>
@GET
(
"$API_URL$OFFER_GET_TOURS_METHOD$DELIMITER"
)
fun
getOfferTours
(
@Query
(
CLIENT_TYPE_PARAM
)
clientType
:
String
=
DEFAULT_CLIENT_TYPE
,
@Query
(
CLIENT_VERSION_PARAM
)
clientVersion
:
String
=
DEFAULT_CLIENT_VERSION
,
@Query
(
API_VERSION_PARAM
)
apiVersion
:
String
=
DEFAULT_API_VERSION
,
@Query
(
LANG_PARAM
)
languageCode
:
String
=
Locale
.
getDefault
().
language
,
@Query
(
OFFER_GET_TOURS_METHOD
)
offerId
:
Int
):
Observable
<
Response
<
OfferTours
>>
@Streaming
@GET
fun
requestFile
(
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/api/biganto/raw/RawData.kt
View file @
5b64fc34
...
...
@@ -95,6 +95,11 @@ data class TourGetFilesRaw(
val
errors
:
List
<
ErrorRaw
>?
)
data class
OfferTours
(
val
data
:
Map
<
Int
,
List
<
TourPreviewRaw
>>,
val
errors
:
List
<
ErrorRaw
>?
)
data class
AppVersionRaw
(
val
current_version
:
String
,
val
download_url
:
String
?,
...
...
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