Commit 6a91365e authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

added api model raws

parent 180f697f
......@@ -121,6 +121,15 @@ dependencies {
implementation "com.jakewharton.rxbinding3:rxbinding-material:$rxBindingVersion"
//Retrofit2
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.2'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.14.0'
//Tests
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
......
package com.biganto.visual.roompark.data.repository.api.retrofit
import io.reactivex.Observable
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.Query
/**
* Created by Vladislav Bogdashkin on 13.06.2018.
*/
interface IRoomParkMobileApi{
companion object{
// const val BASE_URL="https://stage.room-park.ru:38386"
const val BASE_URL="https://room-park.ru"
//const val API_URL="api-novus/"
const val API_URL="api/"
const val DELIMITER="?"
const val CLIENT_TYPE_PARAM="client"
const val CLIENT_VERSION_PARAM="client_version"
const val API_VERSION_PARAM="v"
const val AUTH_TOKEN="auth_token"
const val LANG_PARAM="lang"
const val DEFAULT_LANG_VALUE="en"
const val DEFAULT_CLIENT_TYPE="androidplayer"
//const val DEFAULT_CLIENT_TYPE="iosplayer"
const val OLD_CLIENT_TYPE="mobileplayer"
const val DEFAULT_CLIENT_VERSION="3.0"
const val DEFAULT_API_VERSION="2.0"
//region AppInfo
const val GET_APP_VERSION="misc.appVersion"
//endregion
//region GetEstates
const val GET_ZONES_METHOD="vr.getZones"
//endregion
//region GetToursOverview
const val GET_TOURS_METHOD="vr.getTours"//"tours.getList"
//const val PARENT_ESTATE_PARAM="id"
const val PARENT_ZONE_PARAM="zone"
//endregion
}
@GET("$API_URL$GET_ZONES_METHOD$DELIMITER")
fun authoriz(
@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
): Observable<Response<String>>
@GET("$API_URL$GET_TOURS_METHOD$DELIMITER")
fun getToursPreviewById(
@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(PARENT_ZONE_PARAM) id: String
): Observable<Response<String>>
}
\ No newline at end of file
package com.biganto.visual.roompark.data.repository.api.retrofit.raw
import java.util.*
/**
* Created by Vladislav Bogdashkin on 28.10.2019.
*/
data class AuthRaw(
val token:String,
val id: Int,
val email:String,
val name:String
)
data class StatusResponse(val status:String)
data class DealRaw(
val id:Int,
val estate_id:Int,
val opportunity_sum:Int,
val payment_sum:Int,
val amount_pay_sum:Int,
val status_id:Int,
val manager:String,
val estate:EstateRaw
)
data class EstateRaw(
val id:Int,
val type:String,
val number:String,
val common_info: CommonInfoRaw,
val plan_png:PlanRaw?,
val plan_jpg:PlanRaw?,
val url:String,
val album_id:Int,
val multitour_id:Int?,
val explications: List<ExplicationRaw>?
)
data class PlanRaw(
val url:String,
val width:Int,
val height:Int
)
data class CommonInfoRaw(
val building: Int,
val section_begin:Int,
val floor:Int,
val floor_max:Int,
val area: Float?,
val area_living: Float?,
val kind: String?,
val decoration: String?,
val ceiling:Float?,
val windows_face:String?,
val direction: String?,
val price_meter:Int?,
val price:Int?,
val discount: Float?,
val doscount_amount: Int?,
val dependent: Boolean?,
val rooms:Int?
)
data class ExplicationRaw(val plan_id:Int,val items:List<EstateRoomRaw>)
data class EstateRoomRaw(
val title:String,
val living:Boolean,
val area:Float
)
data class FeedRaw(
val id:Int,
val alias:String,
val title:String
)
data class ArticlesListPaginationRaw(
val page:Int,
val pagesize:Int,
val total:Int,
val pages:Int,
val items:List<NewsArticleRaw>
)
data class NewsArticleRaw(
val id:Int,
val published: Date,
val title:String,
val announce:String,
val preview: String?
)
data class ArticleRaw(
val id:Int,
val published: Date,
val title:String,
val body:String,
val feed_alias:String,
val photo:List<NewsPhotoRaw>?
)
data class NewsPhotoRaw(
val title:String,
val url:String
)
data class ImageAlbumRaw(
val id:Int,
val title:String,
val sort:Int,
val date:Date,
val parent_id:Int
)
data class GalleryImageRaw(
val id:Int,
val title:String,
val description:String,
val sort:Int,
val album_id:Int,
val resolutions:List<ResolutionRaw>
)
data class ResolutionRaw(
val res_name:String,
val url:String,
val width:Int,
val height:Int
)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment