From 5721506007f4822a7df46d9b6749e693426f6745 Mon Sep 17 00:00:00 2001 From: Amine Date: Sun, 29 Oct 2017 20:10:02 +0100 Subject: [PATCH] Maybe fixed issue with marking items. --- .../api/selfoss/SelfossService.kt | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossService.kt b/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossService.kt index 1d8488b..83df5f0 100644 --- a/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossService.kt +++ b/app/src/main/java/apps/amine/bou/readerforselfoss/api/selfoss/SelfossService.kt @@ -1,21 +1,16 @@ package apps.amine.bou.readerforselfoss.api.selfoss import retrofit2.Call -import retrofit2.http.DELETE -import retrofit2.http.Field -import retrofit2.http.FormUrlEncoded -import retrofit2.http.GET -import retrofit2.http.POST -import retrofit2.http.Path -import retrofit2.http.Query - +import retrofit2.http.* // codebeat:disable[ARITY] internal interface SelfossService { + @GET("login") fun loginToSelfoss(@Query("username") username: String, @Query("password") password: String): Call + @GET("items") fun getItems(@Query("type") type: String, @Query("tag") tag: String?, @@ -26,17 +21,21 @@ internal interface SelfossService { @Query("items") items: Int, @Query("offset") offset: Int): Call> + + @Headers("Content-Type: application/json") @POST("mark/{id}") fun markAsRead(@Path("id") id: String, @Query("username") username: String, @Query("password") password: String): Call + @Headers("Content-Type: application/json") @POST("unmark/{id}") fun unmarkAsRead(@Path("id") id: String, @Query("username") username: String, @Query("password") password: String): Call + @FormUrlEncoded @POST("mark") fun markAllAsRead(@Field("ids[]") ids: List, @@ -44,12 +43,14 @@ internal interface SelfossService { @Query("password") password: String): Call + @Headers("Content-Type: application/json") @POST("starr/{id}") fun starr(@Path("id") id: String, @Query("username") username: String, @Query("password") password: String): Call + @Headers("Content-Type: application/json") @POST("unstarr/{id}") fun unstarr(@Path("id") id: String, @Query("username") username: String, @@ -70,10 +71,12 @@ internal interface SelfossService { fun update(@Query("username") username: String, @Query("password") password: String): Call + @GET("sources/spouts") fun spouts(@Query("username") username: String, @Query("password") password: String): Call> + @GET("sources/list") fun sources(@Query("username") username: String, @Query("password") password: String): Call> @@ -84,6 +87,7 @@ internal interface SelfossService { @Query("username") username: String, @Query("password") password: String): Call + @FormUrlEncoded @POST("source") fun createSource(@Field("title") title: String,