refactor(SearchForumBean.java): 使用 Kotlin 重写
This commit is contained in:
parent
4f339e594a
commit
37cc47b456
|
|
@ -1,154 +1,96 @@
|
||||||
package com.huanchengfly.tieba.api.models;
|
package com.huanchengfly.tieba.api.models
|
||||||
|
|
||||||
import com.google.gson.annotations.JsonAdapter;
|
import com.google.gson.annotations.JsonAdapter
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName
|
||||||
import com.huanchengfly.tieba.api.adapters.ExactMatchAdapter;
|
import com.huanchengfly.tieba.api.adapters.ExactMatchAdapter
|
||||||
import com.huanchengfly.tieba.api.adapters.ForumFuzzyMatchAdapter;
|
import com.huanchengfly.tieba.api.adapters.ForumFuzzyMatchAdapter
|
||||||
import com.huanchengfly.tieba.post.models.BaseBean;
|
import com.huanchengfly.tieba.post.models.BaseBean
|
||||||
|
|
||||||
import java.util.List;
|
class SearchForumBean : BaseBean() {
|
||||||
|
|
||||||
public class SearchForumBean extends BaseBean {
|
|
||||||
@SerializedName("no")
|
@SerializedName("no")
|
||||||
private int errorCode;
|
val errorCode: Int? = null
|
||||||
|
|
||||||
@SerializedName("error")
|
@SerializedName("error")
|
||||||
private String errorMsg;
|
val errorMsg: String? = null
|
||||||
private DataBean data;
|
val data: DataBean? = null
|
||||||
|
|
||||||
public int getErrorCode() {
|
class ExactForumInfoBean : ForumInfoBean() {
|
||||||
return errorCode;
|
val intro: String? = null
|
||||||
}
|
val slogan: String? = null
|
||||||
|
|
||||||
public String getErrorMsg() {
|
|
||||||
return errorMsg;
|
|
||||||
}
|
|
||||||
|
|
||||||
public DataBean getData() {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class ExactForumInfoBean extends ForumInfoBean {
|
|
||||||
private String intro;
|
|
||||||
private String slogan;
|
|
||||||
@SerializedName("is_jiucuo")
|
@SerializedName("is_jiucuo")
|
||||||
private int isJiucuo;
|
val isJiucuo: Int? = null
|
||||||
|
|
||||||
public String getIntro() {
|
|
||||||
return intro;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getSlogan() {
|
|
||||||
return slogan;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getIsJiucuo() {
|
|
||||||
return isJiucuo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class ForumInfoBean {
|
open class ForumInfoBean {
|
||||||
@SerializedName("forum_id")
|
@SerializedName("forum_id")
|
||||||
private int forumId;
|
var forumId: Int? = null
|
||||||
|
|
||||||
@SerializedName("forum_name")
|
@SerializedName("forum_name")
|
||||||
private String forumName;
|
var forumName: String? = null
|
||||||
|
|
||||||
@SerializedName("forum_name_show")
|
@SerializedName("forum_name_show")
|
||||||
private String forumNameShow;
|
var forumNameShow: String? = null
|
||||||
private String avatar;
|
var avatar: String? = null
|
||||||
|
|
||||||
@SerializedName("post_num")
|
@SerializedName("post_num")
|
||||||
private String postNum;
|
var postNum: String? = null
|
||||||
|
|
||||||
@SerializedName("concern_num")
|
@SerializedName("concern_num")
|
||||||
private String concernNum;
|
var concernNum: String? = null
|
||||||
|
|
||||||
@SerializedName("has_concerned")
|
@SerializedName("has_concerned")
|
||||||
private int hasConcerned;
|
var hasConcerned: Int? = null
|
||||||
|
|
||||||
public int getForumId() {
|
fun setForumId(forumId: Int): ForumInfoBean {
|
||||||
return forumId;
|
this.forumId = forumId
|
||||||
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
public ForumInfoBean setForumId(int forumId) {
|
fun setForumName(forumName: String?): ForumInfoBean {
|
||||||
this.forumId = forumId;
|
this.forumName = forumName
|
||||||
return this;
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getForumName() {
|
fun setForumNameShow(forumNameShow: String?): ForumInfoBean {
|
||||||
return forumName;
|
this.forumNameShow = forumNameShow
|
||||||
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
public ForumInfoBean setForumName(String forumName) {
|
fun setAvatar(avatar: String?): ForumInfoBean {
|
||||||
this.forumName = forumName;
|
this.avatar = avatar
|
||||||
return this;
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getForumNameShow() {
|
fun setPostNum(postNum: String?): ForumInfoBean {
|
||||||
return forumNameShow;
|
this.postNum = postNum
|
||||||
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
public ForumInfoBean setForumNameShow(String forumNameShow) {
|
fun setConcernNum(concernNum: String?): ForumInfoBean {
|
||||||
this.forumNameShow = forumNameShow;
|
this.concernNum = concernNum
|
||||||
return this;
|
return this
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAvatar() {
|
fun setHasConcerned(hasConcerned: Int): ForumInfoBean {
|
||||||
return avatar;
|
this.hasConcerned = hasConcerned
|
||||||
}
|
return this
|
||||||
|
|
||||||
public ForumInfoBean setAvatar(String avatar) {
|
|
||||||
this.avatar = avatar;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getPostNum() {
|
|
||||||
return postNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ForumInfoBean setPostNum(String postNum) {
|
|
||||||
this.postNum = postNum;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getConcernNum() {
|
|
||||||
return concernNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ForumInfoBean setConcernNum(String concernNum) {
|
|
||||||
this.concernNum = concernNum;
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getHasConcerned() {
|
|
||||||
return hasConcerned;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ForumInfoBean setHasConcerned(int hasConcerned) {
|
|
||||||
this.hasConcerned = hasConcerned;
|
|
||||||
return this;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DataBean {
|
inner class DataBean {
|
||||||
@SerializedName("has_more")
|
@SerializedName("has_more")
|
||||||
private int hasMore;
|
val hasMore = 0
|
||||||
|
|
||||||
@SerializedName("pn")
|
@SerializedName("pn")
|
||||||
private int page;
|
val page = 0
|
||||||
@JsonAdapter(ForumFuzzyMatchAdapter.class)
|
|
||||||
private List<ForumInfoBean> fuzzyMatch;
|
|
||||||
@JsonAdapter(ExactMatchAdapter.class)
|
|
||||||
private ExactForumInfoBean exactMatch;
|
|
||||||
|
|
||||||
public int getHasMore() {
|
@JsonAdapter(ForumFuzzyMatchAdapter::class)
|
||||||
return hasMore;
|
val fuzzyMatch: List<ForumInfoBean>? = null
|
||||||
}
|
|
||||||
|
|
||||||
public int getPage() {
|
@JsonAdapter(ExactMatchAdapter::class)
|
||||||
return page;
|
val exactMatch: ExactForumInfoBean? = null
|
||||||
}
|
|
||||||
|
|
||||||
public List<ForumInfoBean> getFuzzyMatch() {
|
|
||||||
return fuzzyMatch;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ExactForumInfoBean getExactMatch() {
|
|
||||||
return exactMatch;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue