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

This commit is contained in:
GoFly233 2020-08-13 20:30:35 +08:00 committed by HuanChengFly
parent 8dc1e6091a
commit ae15e8e9ff
1 changed files with 40 additions and 119 deletions

View File

@ -1,142 +1,63 @@
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 com.huanchengfly.tieba.post.models.BaseBean; import com.huanchengfly.tieba.post.models.BaseBean
import java.util.List; class UpdateInfoBean : BaseBean() {
public class UpdateInfoBean extends BaseBean {
@SerializedName("gruops") @SerializedName("gruops")
private List<GroupInfo> groups; val groups: List<GroupInfo>? = null
private List<SupportmentBean> supportment; val supportment: List<SupportmentBean>? = null
public List<SupportmentBean> getSupportment() { class SupportmentBean {
return supportment; val id: String? = null
} val title: String? = null
val subtitle: String? = null
public List<GroupInfo> getGroups() {
return groups;
}
public static class SupportmentBean {
private String id;
private String title;
private String subtitle;
@SerializedName("expire_time") @SerializedName("expire_time")
private long expireTime; val expireTime: Long = 0
private IconBean icon; val icon: IconBean? = null
private ActionBean action; val action: ActionBean? = null
public String getId() { class IconBean {
return id; val type = 0
} val id: String? = null
val url: String? = null
public long getExpireTime() { companion object {
return expireTime; const val TYPE_RESOURCE = 0
} const val TYPE_IMAGE = 1
public String getTitle() {
return title;
}
public String getSubtitle() {
return subtitle;
}
public IconBean getIcon() {
return icon;
}
public ActionBean getAction() {
return action;
}
public static class IconBean {
public static final int TYPE_RESOURCE = 0;
public static final int TYPE_IMAGE = 1;
private int type;
private String id;
private String url;
public int getType() {
return type;
}
public String getId() {
return id;
}
public String getUrl() {
return url;
} }
} }
public static class ActionBean { class ActionBean {
public static final int TYPE_LINK = 0; val type = 0
public static final int TYPE_IMAGE = 1; val url: String? = null
private int type;
private String url;
public int getType() { companion object {
return type; const val TYPE_LINK = 0
} const val TYPE_IMAGE = 1
public String getUrl() {
return url;
} }
} }
} }
public static class WebDiskBean { class WebDiskBean {
private String link; val link: String? = null
private String name; val name: String? = null
private String password; val password: String? = null
public String getLink() {
return link;
}
public String getName() {
return name;
}
public String getPassword() {
return password;
}
} }
public class GroupInfo { inner class GroupInfo {
private String type; val type: String? = null
private String name; val name: String? = null
@SerializedName("qq_group_key") @SerializedName("qq_group_key")
private String QGroupKey; val qGroupKey: String? = null
@SerializedName("qq_group_number") @SerializedName("qq_group_number")
private String QGroupNumber; val qGroupNumber: String? = null
private String link; val link: String? = null
private boolean enabled; val isEnabled = false
public String getType() {
return type;
}
public String getQGroupNumber() {
return QGroupNumber;
}
public String getQGroupKey() {
return QGroupKey;
}
public String getName() {
return name;
}
public String getLink() {
return link;
}
public boolean isEnabled() {
return enabled;
}
} }
} }