From 26f16b489e8c9c72140094ff47d905f1aaad6eca Mon Sep 17 00:00:00 2001 From: GoFly233 Date: Thu, 13 Aug 2020 20:16:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor(NewUpdateBean.java):=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20Kotlin=20=E9=87=8D=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tieba/api/models/NewUpdateBean.kt | 95 +++++-------------- .../models/{ParamBean.java => ParamBean.kt} | 0 2 files changed, 24 insertions(+), 71 deletions(-) rename app/src/main/java/com/huanchengfly/tieba/api/models/{ParamBean.java => ParamBean.kt} (100%) diff --git a/app/src/main/java/com/huanchengfly/tieba/api/models/NewUpdateBean.kt b/app/src/main/java/com/huanchengfly/tieba/api/models/NewUpdateBean.kt index 6ca425cb..644d2080 100644 --- a/app/src/main/java/com/huanchengfly/tieba/api/models/NewUpdateBean.kt +++ b/app/src/main/java/com/huanchengfly/tieba/api/models/NewUpdateBean.kt @@ -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") - private boolean hasUpdate; + val isHasUpdate: Boolean? = null + @SerializedName("error_code") - private int errorCode; + val errorCode: Int? = null + @SerializedName("error_message") - private String errorMsg; - private ResultBean result; + val errorMsg: String? = null + val result: ResultBean? = null - public int getErrorCode() { - return errorCode; - } + class ResultBean { + 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") - private List updateContent; + val updateContent: List? = null + @SerializedName("version_code") - private int versionCode; + val versionCode: Int? = null + @SerializedName("version_name") - private String versionName; + val versionName: String? = null + @SerializedName("version_type") - private int versionType; - private List downloads; - - public List getDownloads() { - return downloads; - } - - public boolean isCancelable() { - return cancelable; - } - - public List getUpdateContent() { - return updateContent; - } - - public int getVersionCode() { - return versionCode; - } - - public String getVersionName() { - return versionName; - } - - public int getVersionType() { - return versionType; - } + val versionType: Int? = null + val downloads: List? = null } - public static class DownloadBean { - private String name; - private String url; - - public String getName() { - return name; - } - - public String getUrl() { - return url; - } + class DownloadBean { + val name: String? = null + val url: String? = null } -} +} \ No newline at end of file diff --git a/app/src/main/java/com/huanchengfly/tieba/api/models/ParamBean.java b/app/src/main/java/com/huanchengfly/tieba/api/models/ParamBean.kt similarity index 100% rename from app/src/main/java/com/huanchengfly/tieba/api/models/ParamBean.java rename to app/src/main/java/com/huanchengfly/tieba/api/models/ParamBean.kt