-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move thanks API into main commons codebase (#5463)
* Move thanks API into main commons codebase * KDoc * KDoc --------- Co-authored-by: Nicolas Raoul <nicolas.raoul@gmail.com>
- Loading branch information
1 parent
2c086b3
commit ef47b70
Showing
7 changed files
with
61 additions
and
54 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
app/src/main/java/fr/free/nrw/commons/actions/MwThankPostResponse.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package fr.free.nrw.commons.actions | ||
|
||
import org.wikipedia.dataclient.mwapi.MwResponse | ||
|
||
/** | ||
* Response of the Thanks API. | ||
* Context: | ||
* The Commons Android app lets you thank other contributors who have uploaded a great picture. | ||
* See https://www.mediawiki.org/wiki/Extension:Thanks | ||
*/ | ||
class MwThankPostResponse : MwResponse() { | ||
var result: Result? = null | ||
|
||
inner class Result { | ||
var success: Int? = null | ||
var recipient: String? = null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/src/main/java/fr/free/nrw/commons/actions/ThanksInterface.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package fr.free.nrw.commons.actions | ||
|
||
import io.reactivex.Observable | ||
import org.wikipedia.dataclient.Service | ||
import retrofit2.http.Field | ||
import retrofit2.http.FormUrlEncoded | ||
import retrofit2.http.POST | ||
|
||
/** | ||
* Thanks API. | ||
* Context: | ||
* The Commons Android app lets you thank another contributor who has uploaded a great picture. | ||
* See https://www.mediawiki.org/wiki/Extension:Thanks | ||
*/ | ||
interface ThanksInterface { | ||
@FormUrlEncoded | ||
@POST(Service.MW_API_PREFIX + "action=thank") | ||
fun thank( | ||
@Field("rev") rev: String?, | ||
@Field("log") log: String?, | ||
@Field("token") token: String, | ||
@Field("source") source: String? | ||
): Observable<MwThankPostResponse?> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 0 additions & 38 deletions
38
data-client/src/main/java/org/wikipedia/dataclient/mwapi/page/MwThankPostResponse.java
This file was deleted.
Oops, something went wrong.