mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-29 22:03:55 +01:00
Convert few model classes to kotlin (#3270)
This commit is contained in:
parent
d0f97398a5
commit
b0be4970ef
86 changed files with 661 additions and 1300 deletions
|
|
@ -1,55 +0,0 @@
|
|||
package fr.free.nrw.commons.campaigns;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* A data class to hold a campaign
|
||||
*/
|
||||
public class Campaign {
|
||||
|
||||
@SerializedName("title") private String title;
|
||||
@SerializedName("description") private String description;
|
||||
@SerializedName("startDate") private String startDate;
|
||||
@SerializedName("endDate") private String endDate;
|
||||
@SerializedName("link") private String link;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public String getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
}
|
||||
10
app/src/main/java/fr/free/nrw/commons/campaigns/Campaign.kt
Normal file
10
app/src/main/java/fr/free/nrw/commons/campaigns/Campaign.kt
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
package fr.free.nrw.commons.campaigns
|
||||
|
||||
/**
|
||||
* A data class to hold a campaign
|
||||
*/
|
||||
data class Campaign(var title: String? = null,
|
||||
var description: String? = null,
|
||||
var startDate: String? = null,
|
||||
var endDate: String? = null,
|
||||
var link: String? = null)
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
package fr.free.nrw.commons.campaigns;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* A data class to hold the campaign configs
|
||||
*/
|
||||
class CampaignConfig {
|
||||
|
||||
@SerializedName("showOnlyLiveCampaigns") private boolean showOnlyLiveCampaigns;
|
||||
@SerializedName("sortBy") private String sortBy;
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
package fr.free.nrw.commons.campaigns
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
/**
|
||||
* A data class to hold the campaign configs
|
||||
*/
|
||||
class CampaignConfig {
|
||||
@SerializedName("showOnlyLiveCampaigns")
|
||||
private val showOnlyLiveCampaigns = false
|
||||
@SerializedName("sortBy")
|
||||
private val sortBy: String? = null
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
package fr.free.nrw.commons.campaigns;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Data class to hold the response from the campaigns api
|
||||
*/
|
||||
public class CampaignResponseDTO {
|
||||
|
||||
@SerializedName("config")
|
||||
private CampaignConfig campaignConfig;
|
||||
|
||||
@SerializedName("campaigns")
|
||||
private List<Campaign> campaigns;
|
||||
|
||||
public CampaignConfig getCampaignConfig() {
|
||||
return campaignConfig;
|
||||
}
|
||||
|
||||
public List<Campaign> getCampaigns() {
|
||||
return campaigns;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package fr.free.nrw.commons.campaigns
|
||||
|
||||
import com.google.gson.annotations.SerializedName
|
||||
|
||||
/**
|
||||
* Data class to hold the response from the campaigns api
|
||||
*/
|
||||
class CampaignResponseDTO {
|
||||
@SerializedName("config")
|
||||
val campaignConfig: CampaignConfig? = null
|
||||
@SerializedName("campaigns")
|
||||
val campaigns: List<Campaign>? = null
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue