1 package com.moiseum.wolnelektury.connection.services;
3 import com.moiseum.wolnelektury.connection.models.BookDetailsModel;
4 import com.moiseum.wolnelektury.connection.models.BookModel;
5 import com.moiseum.wolnelektury.connection.models.FavouriteStateModel;
6 import com.moiseum.wolnelektury.connection.models.ReadingStateModel;
10 import io.reactivex.Single;
11 import okhttp3.ResponseBody;
12 import retrofit2.Call;
13 import retrofit2.http.GET;
14 import retrofit2.http.Headers;
15 import retrofit2.http.POST;
16 import retrofit2.http.Path;
17 import retrofit2.http.Query;
18 import retrofit2.http.Streaming;
19 import retrofit2.http.Url;
22 * Created by Piotr Ostrowski on 16.11.2017.
25 public interface BooksService {
27 @Headers("New-Api: true")
29 Call<List<BookModel>> getSearchBooks(@Query("search") String search, @Query("epochs") String epochs, @Query("genres") String genres, @Query("kinds") String kinds,
30 @Query("audiobook") Boolean audiobook, @Query("lektura") Boolean lecture, @Query("after") String lastKey, @Query("count") int count);
33 Single<BookDetailsModel> getBookDetails(@Path("slug") String slug);
37 Call<ResponseBody> downloadFileWithUrl(@Url String fileUrl);
39 @Headers("New-Api: true")
41 Call<List<BookModel>> getNewest();
43 @Headers("New-Api: true")
45 Call<List<BookModel>> getRecommended();
47 @Headers("New-Api: true")
49 Call<List<BookModel>> getAudiobooks(@Query("after") String lastKey, @Query("count") int count);
51 @Headers("Authentication-Required: true")
52 @POST("reading/{slug}/{state}/")
53 Single<ReadingStateModel> setReadingState(@Path("slug") String slug, @Path("state") String state);
55 @Headers("Authentication-Required: true")
56 @GET("reading/{slug}/")
57 Single<ReadingStateModel> getReadingState(@Path("slug") String slug);
59 @Headers({"Authentication-Required: true", "New-Api: true"})
60 @GET("shelf/{state}/")
61 Call<List<BookModel>> getReadenBooks(@Path("state") String state, @Query("after") String lastKey, @Query("count") int count);
63 @Headers("Authentication-Required: true")
65 Single<FavouriteStateModel> setFavouriteState(@Path("slug") String slug, @Query("action") String action);
67 @Headers("Authentication-Required: true")
69 Single<FavouriteStateModel> getFavouriteState(@Path("slug") String slug);
72 Call<List<BookDetailsModel>> getPreview();
75 Call<BookDetailsModel> getPreviewMockup(@Path("slug") String slug);
77 @Headers({"Authentication-Required: true", "New-Api: true"})
79 Call<List<BookModel>> getFavourites(@Query("after") String lastKey, @Query("count") int count);