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,31 +0,0 @@
package fr.free.nrw.commons.mwapi;
import fr.free.nrw.commons.wikidata.mwapi.MwQueryResponse;
import java.util.Map;
import io.reactivex.Observable;
import retrofit2.http.GET;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;
import static fr.free.nrw.commons.wikidata.WikidataConstants.MW_API_PREFIX;
public interface UserInterface {
/**
* Gets the log events of user
* @param user name of user without prefix
* @param continuation continuation params returned in previous query
* @return query response
*/
@GET(MW_API_PREFIX + "action=query&list=logevents&letype=upload&leprop=title|timestamp|ids&lelimit=500")
Observable<MwQueryResponse> getUserLogEvents(@Query("leuser") String user, @QueryMap Map<String, String> continuation);
/**
* Checks to see if a user is currently blocked from Commons
*/
@GET(MW_API_PREFIX + "action=query&meta=userinfo&uiprop=blockinfo")
Observable<MwQueryResponse> getUserBlockInfo();
}

View file

@ -0,0 +1,28 @@
package fr.free.nrw.commons.mwapi
import fr.free.nrw.commons.wikidata.WikidataConstants
import fr.free.nrw.commons.wikidata.mwapi.MwQueryResponse
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.Query
import retrofit2.http.QueryMap
interface UserInterface {
/**
* Gets the log events of user
* @param user name of user without prefix
* @param continuation continuation params returned in previous query
* @return query response
*/
@GET(WikidataConstants.MW_API_PREFIX + "action=query&list=logevents&letype=upload&leprop=title|timestamp|ids&lelimit=500")
fun getUserLogEvents(
@Query("leuser") user: String?,
@QueryMap continuation: Map<String?, String?>?
): Observable<MwQueryResponse>
/**
* Checks to see if a user is currently blocked from Commons
*/
@GET(WikidataConstants.MW_API_PREFIX + "action=query&meta=userinfo&uiprop=blockinfo")
fun getUserBlockInfo(): Observable<MwQueryResponse>
}