1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-26 00:27:30 +00:00

Remove BaseService. Since RetrofitFactory was introduced, BaseService does nothing.

This commit is contained in:
Ammar Githam 2021-06-09 08:46:34 +09:00
parent 29d2b894d8
commit eaac191588
17 changed files with 16 additions and 46 deletions

View File

@ -1,30 +0,0 @@
package awais.instagrabber.webservices;
public abstract class BaseService {
private static final String TAG = "BaseService";
// protected String userBreadcrumb(final int size) {
// final long term = (random(2, 4) * 1000) + size + (random(15, 21) * 1000);
// final float div = (float) size / random(2, 4);
// final int round = Math.round(div);
// final long textChangeEventCount = round > 0 ? round : 1;
// final String data = String.format(Locale.getDefault(), "%d %d %d %d", size, term, textChangeEventCount, new Date().getTime());
// try {
// final Mac hasher = Mac.getInstance("HmacSHA256");
// hasher.init(new SecretKeySpec(Constants.BREADCRUMB_KEY.getBytes(), "HmacSHA256"));
// byte[] hash = hasher.doFinal(data.getBytes());
// final StringBuilder hexString = new StringBuilder();
// for (byte b : hash) {
// final String hex = Integer.toHexString(0xff & b);
// if (hex.length() == 1) hexString.append('0');
// hexString.append(hex);
// }
// final String encodedData = Base64.encodeToString(data.getBytes(), Base64.NO_WRAP);
// final String encodedHex = Base64.encodeToString(hexString.toString().getBytes(), Base64.NO_WRAP);
// return String.format("%s\n%s\n", encodedHex, encodedData);
// } catch (Exception e) {
// Log.e(TAG, "Error creating breadcrumb", e);
// return null;
// }
// }
}

View File

@ -17,7 +17,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class CollectionService extends BaseService { public class CollectionService {
private static final String TAG = "ProfileService"; private static final String TAG = "ProfileService";
private final CollectionRepository repository; private final CollectionRepository repository;

View File

@ -27,7 +27,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class CommentService extends BaseService { public class CommentService {
private static final String TAG = "CommentService"; private static final String TAG = "CommentService";
private final CommentRepository repository; private final CommentRepository repository;

View File

@ -9,7 +9,7 @@ import awais.instagrabber.utils.Utils
import org.json.JSONArray import org.json.JSONArray
import java.util.* import java.util.*
object DirectMessagesService : BaseService() { object DirectMessagesService {
private val repository: DirectMessagesRepository = RetrofitFactory.retrofit.create(DirectMessagesRepository::class.java) private val repository: DirectMessagesRepository = RetrofitFactory.retrofit.create(DirectMessagesRepository::class.java)
suspend fun fetchInbox( suspend fun fetchInbox(

View File

@ -13,7 +13,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class DiscoverService extends BaseService { public class DiscoverService {
private static final String TAG = "DiscoverService"; private static final String TAG = "DiscoverService";

View File

@ -23,7 +23,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class FeedService extends BaseService { public class FeedService {
private static final String TAG = "FeedService"; private static final String TAG = "FeedService";
private final FeedRepository repository; private final FeedRepository repository;

View File

@ -11,7 +11,7 @@ import org.json.JSONArray
import org.json.JSONException import org.json.JSONException
import org.json.JSONObject import org.json.JSONObject
object FriendshipService : BaseService() { object FriendshipService {
private val repository: FriendshipRepository = retrofit.create(FriendshipRepository::class.java) private val repository: FriendshipRepository = retrofit.create(FriendshipRepository::class.java)
suspend fun follow( suspend fun follow(

View File

@ -4,7 +4,7 @@ import awais.instagrabber.repositories.GifRepository;
import awais.instagrabber.repositories.responses.giphy.GiphyGifResponse; import awais.instagrabber.repositories.responses.giphy.GiphyGifResponse;
import retrofit2.Call; import retrofit2.Call;
public class GifService extends BaseService { public class GifService {
private final GifRepository repository; private final GifRepository repository;

View File

@ -12,7 +12,7 @@ import org.json.JSONException
import org.json.JSONObject import org.json.JSONObject
import java.util.* import java.util.*
object GraphQLService : BaseService() { object GraphQLService {
private val repository: GraphQLRepository = retrofitWeb.create(GraphQLRepository::class.java) private val repository: GraphQLRepository = retrofitWeb.create(GraphQLRepository::class.java)
// TODO convert string response to a response class // TODO convert string response to a response class

View File

@ -14,7 +14,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class LocationService extends BaseService { public class LocationService {
private static final String TAG = "LocationService"; private static final String TAG = "LocationService";
private final LocationRepository repository; private final LocationRepository repository;

View File

@ -12,7 +12,7 @@ import awais.instagrabber.utils.retryContextString
import awais.instagrabber.webservices.RetrofitFactory.retrofit import awais.instagrabber.webservices.RetrofitFactory.retrofit
import org.json.JSONObject import org.json.JSONObject
object MediaService : BaseService() { object MediaService {
private val DELETABLE_ITEMS_TYPES = listOf( private val DELETABLE_ITEMS_TYPES = listOf(
MediaItemType.MEDIA_TYPE_IMAGE, MediaItemType.MEDIA_TYPE_IMAGE,
MediaItemType.MEDIA_TYPE_VIDEO, MediaItemType.MEDIA_TYPE_VIDEO,

View File

@ -23,7 +23,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class NewsService extends BaseService { public class NewsService {
private static final String TAG = "NewsService"; private static final String TAG = "NewsService";
private final NewsRepository repository; private final NewsRepository repository;

View File

@ -24,7 +24,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class ProfileService extends BaseService { public class ProfileService {
private static final String TAG = "ProfileService"; private static final String TAG = "ProfileService";
private final ProfileRepository repository; private final ProfileRepository repository;

View File

@ -6,7 +6,7 @@ import awais.instagrabber.repositories.SearchRepository;
import awais.instagrabber.repositories.responses.search.SearchResponse; import awais.instagrabber.repositories.responses.search.SearchResponse;
import retrofit2.Call; import retrofit2.Call;
public class SearchService extends BaseService { public class SearchService {
private static final String TAG = "LocationService"; private static final String TAG = "LocationService";
private final SearchRepository repository; private final SearchRepository repository;

View File

@ -19,7 +19,7 @@ import org.json.JSONArray
import org.json.JSONObject import org.json.JSONObject
import java.util.* import java.util.*
object StoriesService : BaseService() { object StoriesService {
private val repository: StoriesRepository = retrofit.create(StoriesRepository::class.java) private val repository: StoriesRepository = retrofit.create(StoriesRepository::class.java)
suspend fun fetch(mediaId: Long): StoryModel { suspend fun fetch(mediaId: Long): StoryModel {

View File

@ -22,7 +22,7 @@ import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
import retrofit2.Response; import retrofit2.Response;
public class TagsService extends BaseService { public class TagsService {
private static final String TAG = "TagsService"; private static final String TAG = "TagsService";

View File

@ -7,7 +7,7 @@ import awais.instagrabber.repositories.responses.UserSearchResponse
import awais.instagrabber.webservices.RetrofitFactory.retrofit import awais.instagrabber.webservices.RetrofitFactory.retrofit
import java.util.* import java.util.*
object UserRepository : BaseService() { object UserRepository {
private val service: UserService = retrofit.create(UserService::class.java) private val service: UserService = retrofit.create(UserService::class.java)
suspend fun getUserInfo(uid: Long): User { suspend fun getUserInfo(uid: Long): User {