Migrate gotify to new client

This commit is contained in:
Jannis Mattheis
2018-11-14 19:39:22 +01:00
parent 3a9da353b4
commit d4c6273214
13 changed files with 209 additions and 117 deletions

View File

@@ -1,4 +1,21 @@
package com.github.gotify.api;
import java.io.IOException;
import retrofit2.Call;
import retrofit2.Response;
public class Api {
public static <T> T execute(Call<T> call) throws ApiException {
try {
Response<T> response = call.execute();
if (response.isSuccessful()) {
return response.body();
} else {
throw new ApiException(response);
}
} catch (IOException e) {
throw new ApiException(e);
}
}
}