Implemented getLicense function

This commit is contained in:
CappielloAntonio 2021-07-24 14:51:50 +02:00
parent 4053500080
commit 24ca36197c
2 changed files with 10 additions and 5 deletions

View file

@ -5,9 +5,6 @@ import android.util.Log;
import com.cappielloantonio.play.subsonic.Subsonic; import com.cappielloantonio.play.subsonic.Subsonic;
import com.cappielloantonio.play.subsonic.models.SubsonicResponse; import com.cappielloantonio.play.subsonic.models.SubsonicResponse;
import java.util.List;
import java.util.Map;
import okhttp3.OkHttpClient; import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor; import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Call; import retrofit2.Call;
@ -33,11 +30,16 @@ public class SystemClient {
this.systemService = retrofit.create(SystemService.class); this.systemService = retrofit.create(SystemService.class);
} }
public Call<SubsonicResponse> ping(){ public Call<SubsonicResponse> ping() {
Log.d(TAG, "Requesting ping"); Log.d(TAG, "ping()");
return systemService.ping(subsonic.getParams()); return systemService.ping(subsonic.getParams());
} }
public Call<SubsonicResponse> getLicense() {
Log.d(TAG, "getLicense()");
return systemService.getLicense(subsonic.getParams());
}
private OkHttpClient getOkHttpClient() { private OkHttpClient getOkHttpClient() {
return new OkHttpClient.Builder() return new OkHttpClient.Builder()
.addInterceptor(getHttpLoggingInterceptor()) .addInterceptor(getHttpLoggingInterceptor())

View file

@ -11,4 +11,7 @@ import retrofit2.http.QueryMap;
public interface SystemService { public interface SystemService {
@GET("ping") @GET("ping")
Call<SubsonicResponse> ping(@QueryMap Map<String, String> params); Call<SubsonicResponse> ping(@QueryMap Map<String, String> params);
@GET("getLicense")
Call<SubsonicResponse> getLicense(@QueryMap Map<String, String> params);
} }