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

This commit is contained in:
GoFly233 2020-08-13 20:23:30 +08:00 committed by HuanChengFly
parent 1eb00b6a31
commit a7a1942092
2 changed files with 31 additions and 96 deletions

View File

@ -1,116 +1,51 @@
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 SearchThreadBean {
public class SearchThreadBean {
@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() { inner class DataBean {
return errorCode;
}
public String getErrorMsg() {
return errorMsg;
}
public DataBean getData() {
return data;
}
public class DataBean {
@SerializedName("has_more") @SerializedName("has_more")
private int hasMore; val hasMore: Int? = null
@SerializedName("current_page") @SerializedName("current_page")
private int currentPage; val currentPage: Int? = null
@SerializedName("post_list") @SerializedName("post_list")
private List<ThreadInfoBean> postList; val postList: List<ThreadInfoBean>? = null
public int getHasMore() {
return hasMore;
}
public int getCurrentPage() {
return currentPage;
}
public List<ThreadInfoBean> getPostList() {
return postList;
}
} }
public class ThreadInfoBean { inner 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("post_num") @SerializedName("post_num")
private String postNum; val postNum: String? = null
@SerializedName("forum_name") @SerializedName("forum_name")
private String forumName; val forumName: String? = null
private UserInfoBean user; val user: UserInfoBean? = null
private int type; val type: Int? = null
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 String getPostNum() {
return postNum;
}
public UserInfoBean getUser() {
return user;
}
public int getType() {
return type;
}
} }
public class UserInfoBean { inner class UserInfoBean {
@SerializedName("user_name") @SerializedName("user_name")
private String userName; val userName: String? = null
@SerializedName("user_id") @SerializedName("user_id")
private String userId; val userId: String? = null
private String portrait; val portrait: String? = null
public String getUserName() {
return userName;
}
public String getUserId() {
return userId;
}
public String getPortrait() {
return portrait;
}
} }
} }