Skip to content

Commit

Permalink
Rename some entities
Browse files Browse the repository at this point in the history
  • Loading branch information
Bohdan committed Jan 13, 2021
1 parent deb2e53 commit 1a5a292
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions bagisto-sdk/src/main/java/com/ideil/bagistosdk/BagistoApi.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.ideil.bagistosdk

import com.ideil.bagistosdk.api.BasketApiService
import com.ideil.bagistosdk.api.BagistoRetrofitManager
import com.ideil.bagistosdk.entity.category.BagistoCategoryApi
import com.ideil.bagistosdk.entity.category.BagistoCategory
import com.ideil.bagistosdk.entity.response.BagistoGetProductsResponse
import com.ideil.bagistosdk.entity.response.BagistoGetCategoriesResponse
import retrofit2.Retrofit
Expand All @@ -18,7 +18,7 @@ class BagistoApi {
* @param categoryId - Category id
* @return [Result] of category list
* */
suspend fun getCategory(categoryId: Long): Result<List<BagistoCategoryApi>> {
suspend fun getCategory(categoryId: Long): Result<List<BagistoCategory>> {
return kotlin.runCatching { apiService.getCategoryById(categoryId.toString()) }
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ideil.bagistosdk.api

import com.ideil.bagistosdk.entity.category.BagistoCategoryApi
import com.ideil.bagistosdk.entity.category.BagistoCategory
import com.ideil.bagistosdk.entity.response.BagistoGetProductsResponse
import com.ideil.bagistosdk.entity.response.BagistoGetCategoriesResponse
import retrofit2.http.GET
Expand Down Expand Up @@ -31,13 +31,13 @@ interface BasketApiService {
* Get category by id
* */
@GET(URL_CATEGORY_BY_ID)
suspend fun getCategoryById(@Path("id") id: String): List<BagistoCategoryApi>
suspend fun getCategoryById(@Path("id") id: String): List<BagistoCategory>

/**
* Get descendant categories
* */
@GET(URL_CATEGORY_DESCENDANT)
suspend fun getCategoriesDescendant(@Query("parent_id") parentId: String): List<BagistoCategoryApi>
suspend fun getCategoriesDescendant(@Query("parent_id") parentId: String): List<BagistoCategory>

/**
* Get products
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import kotlinx.android.parcel.Parcelize
* Data class for represent category from api
* */
@Parcelize
data class BagistoCategoryApi(
data class BagistoCategory(
@SerializedName("id")
val id: Int?,
@SerializedName("code")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import android.os.Parcelable
* Data class for represent product from api
* */
@Parcelize
data class BagistoProductApi(
data class BagistoProduct(
@SerializedName("id")
val id: Int?,
@SerializedName("type")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ package com.ideil.bagistosdk.entity.response
import com.google.gson.annotations.SerializedName
import kotlinx.android.parcel.Parcelize
import android.os.Parcelable
import com.ideil.bagistosdk.entity.category.BagistoCategoryApi
import com.ideil.bagistosdk.entity.category.BagistoCategory
import com.ideil.bagistosdk.entity.BagistoLinks
import com.ideil.bagistosdk.entity.BagistoMeta

@Parcelize
data class BagistoGetCategoriesResponse(
@SerializedName("data")
val data: List<BagistoCategoryApi>?,
val data: List<BagistoCategory>?,
@SerializedName("links")
val links: BagistoLinks?,
@SerializedName("meta")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import kotlinx.android.parcel.Parcelize
import android.os.Parcelable
import com.ideil.bagistosdk.entity.BagistoLinks
import com.ideil.bagistosdk.entity.BagistoMeta
import com.ideil.bagistosdk.entity.product.BagistoProductApi
import com.ideil.bagistosdk.entity.product.BagistoProduct

/**
* Data class for represent get products response
* */
@Parcelize
data class BagistoGetProductsResponse(
@SerializedName("data")
val data: List<BagistoProductApi>?,
val data: List<BagistoProduct>?,
@SerializedName("links")
val links: BagistoLinks?,
@SerializedName("meta")
Expand Down

0 comments on commit 1a5a292

Please sign in to comment.