Consistent api interfaces (#5530)

* Converted CategoryInterface to kotlin

* Converted DepictsInterface to kotlin

* Convert the MediaDetailInterface to kotlin

* Convert MediaInterface to kotlin

* Convert ReviewInterface to kotlin

* Convert the UserInterface to kotlin

* Convert the WikiBaseInterface to kotlin

* Convert WikidataInterface to kotlin

* Convert WikidataMediaInterface to kotlin

* Convert UploadInterface to kotlin
This commit is contained in:
Paul Hawke 2024-02-08 22:43:01 -06:00 committed by GitHub
parent c6cb97e199
commit f9090b0c2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 535 additions and 524 deletions

View file

@ -1,16 +1,14 @@
package fr.free.nrw.commons.review;
package fr.free.nrw.commons.review
import fr.free.nrw.commons.wikidata.mwapi.MwQueryResponse;
import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;
import fr.free.nrw.commons.wikidata.mwapi.MwQueryResponse
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Query
/**
* Interface class for peer review calls
*/
public interface ReviewInterface {
interface ReviewInterface {
/**
* Fetch recent changes from MediaWiki API
* Calls the API for the latest 50 changes (the default limit is 10)
@ -21,11 +19,11 @@ public interface ReviewInterface {
*
*/
@GET("w/api.php?action=query&format=json&formatversion=2&generator=categorymembers&gcmtype=file&gcmsort=timestamp&gcmdir=desc&gcmtitle=Category:Uploaded_with_Mobile/Android&gcmlimit=50")
Observable<MwQueryResponse> getRecentChanges();
fun getRecentChanges(): Observable<MwQueryResponse>
@GET("w/api.php?action=query&format=json&formatversion=2&prop=revisions&rvprop=timestamp|ids|user&rvdir=newer&rvlimit=1")
Observable<MwQueryResponse> getFirstRevisionOfFile(@Query("titles") String titles);
fun getFirstRevisionOfFile(@Query("titles") titles: String?): Observable<MwQueryResponse>
@GET("w/api.php?action=query&format=json&formatversion=2&prop=fileusage|globalusage")
Observable<MwQueryResponse> getGlobalUsageInfo(@Query("titles") String title);
fun getGlobalUsageInfo(@Query("titles") title: String?): Observable<MwQueryResponse>
}