diff --git a/app/src/main/java/com/example/citrusclient/viewmodels/FavoritesViewModel.java b/app/src/main/java/com/example/citrusclient/viewmodels/FavoritesViewModel.java new file mode 100644 index 0000000..bd53028 --- /dev/null +++ b/app/src/main/java/com/example/citrusclient/viewmodels/FavoritesViewModel.java @@ -0,0 +1,20 @@ +package com.example.citrusclient.viewmodels; + +import com.example.citrusclient.rest.FavoritesRest; + +import androidx.lifecycle.ViewModel; +import retrofit2.Retrofit; +import retrofit2.converter.jackson.JacksonConverterFactory; + +public class FavoritesViewModel extends ViewModel { + private final Retrofit retrofit; + private final FavoritesRest favoritesRest; + + public FavoritesViewModel(){ + this.retrofit = new Retrofit.Builder() + .baseUrl("http://nitta-lab-www.is.konan-u.ac.jp/citrus/") + .addConverterFactory(JacksonConverterFactory.create()) + .build(); + this.favoritesRest = retrofit.create(FavoritesRest.class); + } +}