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

This commit is contained in:
GoFly233 2020-08-13 20:22:28 +08:00 committed by HuanChengFly
parent 37cc47b456
commit 1eb00b6a31
2 changed files with 36 additions and 106 deletions

View File

@ -1,128 +1,58 @@
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 SearchPostBean {
public class SearchPostBean {
@SerializedName("error_code") @SerializedName("error_code")
private String errorCode; val errorCode: String? = null
@SerializedName("error_msg") @SerializedName("error_msg")
private String errorMsg; val errorMsg: String? = null
private PageBean page; val page: PageBean? = null
@SerializedName("post_list") @SerializedName("post_list")
private List<ThreadInfoBean> postList; val postList: List<ThreadInfoBean>? = null
public PageBean getPage() { class PageBean {
return page;
}
public List<ThreadInfoBean> getPostList() {
return postList;
}
public String getErrorCode() {
return errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public static class PageBean {
@SerializedName("page_size") @SerializedName("page_size")
private String pageSize; val pageSize: String? = null
private String offset; val offset: String? = null
@SerializedName("current_page") @SerializedName("current_page")
private String currentPage; val currentPage: String? = null
@SerializedName("total_count") @SerializedName("total_count")
private String totalCount; val totalCount: String? = null
@SerializedName("total_page") @SerializedName("total_page")
private String totalPage; val totalPage: String? = null
@SerializedName("has_more") @SerializedName("has_more")
private String hasMore; val hasMore: String? = null
@SerializedName("has_prev") @SerializedName("has_prev")
private String hasPrev; val hasPrev: String? = null
public String getPageSize() {
return pageSize;
}
public String getOffset() {
return offset;
}
public String getCurrentPage() {
return currentPage;
}
public String getTotalCount() {
return totalCount;
}
public String getTotalPage() {
return totalPage;
}
public String getHasMore() {
return hasMore;
}
public String getHasPrev() {
return hasPrev;
}
} }
public static class ThreadInfoBean { class ThreadInfoBean {
private String tid; val tid: String? = null
private String pid; val pid: String? = null
private String title; val title: String? = null
private String content; val content: String? = null
private String time; val time: String? = null
@SerializedName("fname") @SerializedName("fname")
private String forumName; val forumName: String? = null
private AuthorBean author; val author: AuthorBean? = null
public AuthorBean getAuthor() {
return author;
}
public String getForumName() {
return forumName;
}
public String getTid() {
return tid;
}
public String getPid() {
return pid;
}
public String getTitle() {
return title;
}
public String getContent() {
return content;
}
public String getTime() {
return time;
}
} }
public static class AuthorBean { class AuthorBean {
private String name; val name: String? = null
@SerializedName("name_show") @SerializedName("name_show")
private String nameShow; val nameShow: String? = null
public String getName() {
return name;
}
public String getNameShow() {
return nameShow;
}
} }
} }