refactor(NewUpdateBean.java): 使用 Kotlin 重写

This commit is contained in:
GoFly233 2020-08-13 20:16:17 +08:00 committed by HuanChengFly
parent 3aa18ae61a
commit 26f16b489e
2 changed files with 24 additions and 71 deletions

View File

@ -1,86 +1,39 @@
package com.huanchengfly.tieba.api.models; package com.huanchengfly.tieba.api.models
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName
import java.util.List; class NewUpdateBean {
val isSuccess: Boolean? = null
public class NewUpdateBean {
private boolean success;
@SerializedName("has_update") @SerializedName("has_update")
private boolean hasUpdate; val isHasUpdate: Boolean? = null
@SerializedName("error_code") @SerializedName("error_code")
private int errorCode; val errorCode: Int? = null
@SerializedName("error_message") @SerializedName("error_message")
private String errorMsg; val errorMsg: String? = null
private ResultBean result; val result: ResultBean? = null
public int getErrorCode() { class ResultBean {
return errorCode; val isCancelable: Boolean? = null
}
public String getErrorMsg() {
return errorMsg;
}
public boolean isSuccess() {
return success;
}
public boolean isHasUpdate() {
return hasUpdate;
}
public ResultBean getResult() {
return result;
}
public static class ResultBean {
private boolean cancelable;
@SerializedName("update_content") @SerializedName("update_content")
private List<String> updateContent; val updateContent: List<String>? = null
@SerializedName("version_code") @SerializedName("version_code")
private int versionCode; val versionCode: Int? = null
@SerializedName("version_name") @SerializedName("version_name")
private String versionName; val versionName: String? = null
@SerializedName("version_type") @SerializedName("version_type")
private int versionType; val versionType: Int? = null
private List<DownloadBean> downloads; val downloads: List<DownloadBean>? = null
public List<DownloadBean> getDownloads() {
return downloads;
}
public boolean isCancelable() {
return cancelable;
}
public List<String> getUpdateContent() {
return updateContent;
}
public int getVersionCode() {
return versionCode;
}
public String getVersionName() {
return versionName;
}
public int getVersionType() {
return versionType;
}
} }
public static class DownloadBean { class DownloadBean {
private String name; val name: String? = null
private String url; val url: String? = null
public String getName() {
return name;
}
public String getUrl() {
return url;
}
} }
} }