Commit 861721e4 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

added plan types etc api methods

parent 6a91365e
package com.biganto.visual.roompark.data.repository.api.retrofit
import com.biganto.visual.roompark.data.repository.api.retrofit.raw.*
import io.reactivex.Observable
import retrofit2.Response
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.Query
......@@ -41,33 +43,220 @@ interface IRoomParkMobileApi{
const val GET_APP_VERSION="misc.appVersion"
//endregion
//region GetEstates
const val GET_ZONES_METHOD="vr.getZones"
//region Authorization
const val AUTH_METHOD="users.authorize"
const val EMAIL_AUTH_PARAM="email"
const val PASSWORD_AUTH_PARAM="password"
//endregion
//region GetToursOverview
const val GET_TOURS_METHOD="vr.getTours"//"tours.getList"
//const val PARENT_ESTATE_PARAM="id"
const val PARENT_ZONE_PARAM="zone"
//region Subscription
const val SUBSCRIBE_METHOD="users.subscribe"
const val UNSUBSCRIBE_METHOD="users.unsubscribe"
const val DEVICE_TOKEN_SUBSCRIBTION_PARAM="deviceToken"
const val TOPIC_SUBSCRIBTION_PARAM="topic"
val topicTypes = arrayOf(
"deals",
"progress-1",
"progress-2",
"progress-3",
"progress-kindergarden",
"progress-school",
"progress-landscaping",
"news",
"blog",
"constructing-blog"
)
//endregion
//region GetDeals
const val DEALS_METHOD="users.getDeals"
//endregion
//region GetFavorites
const val FAVORITES_METHOD="users.getFavorites"
//endregion
//region GetFavorites
const val FEEDS_METHOD="news.getFeeds"
//endregion
//region GetFavorites
const val GET_ARTICLES_PAGE_METHOD="news.getArticlesList"
const val ARTICLES_PAGINATION_ALIAS_PARAM="feed_alias"
const val ARTICLES_PAGINATION_PAGE_SIZE_PARAM="pagesize "
const val ARTICLES_PAGINATION_PAGE_PARAM="page"
//endregion
//region GetFavorites
const val GET_ARTICLE_METHOD="news.getArticle"
const val ARTICLE_ID_PARAM="article_id"
//endregion
//region GetAlbums
const val ALBUMS_METHOD="progress.getAlbums"
const val PARENT_ALBUMD_ID_PARAM="parent_id"
//endregion
//region GetAlbums
const val PHOTOS_METHOD="progress.getPhotos"
const val PHOTOS_ALBUMD_ID_PARAM="album_id"
//endregion
//region Get Plan Types
const val GET_PLAN_TYPES_METHOD="estates.getPlanTypes"
const val PLAN_TYPES_ESTATE_ID_PARAM="estate_id"
//endregion
//region Get Plan Types
const val GET_DIRECT_PLAN_METHOD="estates.getPlan"
const val DIRECT_PLAN_ESTATE_ID_PARAM="estate_id"
const val DIRECT_PLAN_TYPE_PARAM="plan_type"
val planTypes = arrayListOf(
Pair(0 , "проектная планировка"),
Pair(1 , "перепланировка №1"),
Pair(2 , "перепланировка №2")
)
const val DIRECT_PLAN_FURNITURE_PARAM="furniture"
const val DIRECT_PLAN_SIZES_PARAM="sizes"
const val DIRECT_PLAN_WALLS_PARAM="walls"
const val DIRECT_PLAN_ELECTRIC_PARAM="electric"
//endregion
//region Get MultitourId
const val GET_MULTITOUR_ID="estates.getMultiTour"
const val MULTITOUR_BUILDING_NUMBER_PARAM="building "
const val MULTITOUR_FLAT_NUMBER_PARAM="number "
//endregion
}
@GET("$API_URL$GET_ZONES_METHOD$DELIMITER")
@GET("$API_URL$AUTH_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,
@Query(EMAIL_AUTH_PARAM) email: String,
@Query(PASSWORD_AUTH_PARAM) pwd: String
): Observable<Response<AuthRaw>>
@POST("$API_URL${SUBSCRIBE_METHOD}OD$DELIMITER")
fun subscribe(
@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(AUTH_TOKEN) token: String,
@Query(DEVICE_TOKEN_SUBSCRIBTION_PARAM) deviceToken: String,
@Query(TOPIC_SUBSCRIBTION_PARAM) topic: String
): Observable<Response<StatusResponse>>
@POST("$API_URL${UNSUBSCRIBE_METHOD}OD$DELIMITER")
fun unsubscribe(
@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(AUTH_TOKEN) token: String,
@Query(DEVICE_TOKEN_SUBSCRIBTION_PARAM) deviceToken: String,
@Query(TOPIC_SUBSCRIBTION_PARAM) topic: String
): Observable<Response<StatusResponse>>
@GET("$API_URL$DEALS_METHOD$DELIMITER")
fun getDeals(
@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(AUTH_TOKEN) token: String
): Observable<Response<List<DealRaw>>>
@GET("$API_URL$FAVORITES_METHOD$DELIMITER")
fun getFavorites(
@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(AUTH_TOKEN) token: String
): Observable<Response<List<EstateRaw>>>
@GET("$API_URL$FEEDS_METHOD$DELIMITER")
fun getFeeds(
@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>>
): Observable<Response<List<FeedRaw>>>
@GET("$API_URL$GET_ARTICLES_PAGE_METHOD$DELIMITER")
fun getArticlesPage(
@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(ARTICLES_PAGINATION_ALIAS_PARAM) alias: String,
@Query(ARTICLES_PAGINATION_PAGE_SIZE_PARAM) pageSize: Int,
@Query(ARTICLES_PAGINATION_PAGE_PARAM) page: Int
): Observable<Response<ArticlesListPaginationRaw>>
@GET("$API_URL$GET_ARTICLE_METHOD$DELIMITER")
fun getArticle(
@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(ARTICLE_ID_PARAM) id: Int
): Observable<Response<ArticleRaw>>
@GET("$API_URL$ALBUMS_METHOD$DELIMITER")
fun getAlbums(
@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_ALBUMD_ID_PARAM) id: Int?
): Observable<Response<List<ImageAlbumRaw>>>
@GET("$API_URL$PHOTOS_METHOD$DELIMITER")
fun getPhotos(
@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(PHOTOS_ALBUMD_ID_PARAM) id: Int
): Observable<Response<List<NewsPhotoRaw>>>
@GET("$API_URL$GET_PLAN_TYPES_METHOD$DELIMITER")
fun getPlanTypes(
@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(PLAN_TYPES_ESTATE_ID_PARAM) estateId: Int
): Observable<Response<List<PlanTypeRaw>>>
@GET("$API_URL$GET_DIRECT_PLAN_METHOD$DELIMITER")
fun getPlan(
@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(DIRECT_PLAN_ESTATE_ID_PARAM) estate_id:Int,
@Query(DIRECT_PLAN_TYPE_PARAM) planType:Int,
@Query(DIRECT_PLAN_FURNITURE_PARAM) furniture:Int,
@Query(DIRECT_PLAN_SIZES_PARAM) sizes:Int,
@Query(DIRECT_PLAN_WALLS_PARAM) walls:Int,
@Query(DIRECT_PLAN_ELECTRIC_PARAM) electric:Int
): Observable<Response<List<PlanRaw>>>
@GET("$API_URL$GET_TOURS_METHOD$DELIMITER")
fun getToursPreviewById(
@GET("$API_URL$GET_MULTITOUR_ID$DELIMITER")
fun getMultiTourId(
@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>>
@Query(MULTITOUR_BUILDING_NUMBER_PARAM) building:Int,
@Query(MULTITOUR_FLAT_NUMBER_PARAM) flatNumber:Int
): Observable<Response<List<PlanRaw>>>
}
\ No newline at end of file
......@@ -132,3 +132,13 @@ data class ResolutionRaw(
val width:Int,
val height:Int
)
data class PlanTypeRaw(
val plan_id:Int,
val title:String,
val features: List<String>
)
data class MultiTourRaw(
val multiTourId: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