This commit is contained in:
2023-11-13 22:56:12 +03:00
parent 6d3dfee00b
commit e95c2f5ed8
3 changed files with 8 additions and 7 deletions
@@ -20,7 +20,7 @@ fun Float.formatPrice(): String {
fun ImageView.loadImage(url: String?) { fun ImageView.loadImage(url: String?) {
Picasso.get() Picasso.get()
.load("https://liwapos.com/samba.mobil/Content/$url") .load("https://my-json-server.typicode.com/YarikHumster/SweetShopViki/$url")
.placeholder(R.drawable.loading) .placeholder(R.drawable.loading)
.error(R.drawable.error) .error(R.drawable.error)
.into(this) .into(this)
@@ -8,7 +8,5 @@ data class Product(
@SerializedName("Name") @Expose var name: String?, @SerializedName("Name") @Expose var name: String?,
@SerializedName("ImagePath") @Expose var imagePath: String?, @SerializedName("ImagePath") @Expose var imagePath: String?,
@SerializedName("Price") @Expose var price: Double?, @SerializedName("Price") @Expose var price: Double?,
@SerializedName("MenuItemId") @Expose var menuItemId: Int?, @SerializedName("MenuItemId") @Expose var menuItemId: Int
@SerializedName("GroupName") @Expose var groupName: String?,
@SerializedName("CustomTags") @Expose var customTags: String?,
): Serializable ): Serializable
@@ -7,11 +7,14 @@ import retrofit2.http.GET
import retrofit2.http.Path import retrofit2.http.Path
interface DAOInterface { interface DAOInterface {
@GET("JsonCategories") @GET("categories")
suspend fun getCategories(): Response<List<Categories>> suspend fun getCategories(): Response<List<Categories>>
@GET("JsonItems/{id}")
suspend fun getProducts(@Path("id") id: Int): Response<List<Product>> @GET("categories/{categoryId}/products")
suspend fun getProducts(@Path("categoryId") categoryId: Int): Response<List<Product>>
@GET("JsonSearch") @GET("JsonSearch")
suspend fun getSearch(): Response<List<Product>> suspend fun getSearch(): Response<List<Product>>