粗略完成新问题详情页面

This commit is contained in:
jack
2021-06-05 10:27:49 +08:00
parent 22cadc77f0
commit 898bf3e432
23 changed files with 328 additions and 136 deletions

View File

@ -117,6 +117,7 @@ public class PostCommentUtils {
String articleId,
String articleCommunityId,
String videoId,
String questionId,
final String commentId,
final PostCommentListener listener) {
@ -126,6 +127,8 @@ public class PostCommentUtils {
observable = RetrofitManager.getInstance(context).getApi().postVoteAnswerComment(answerId, commentId);
} else if (!TextUtils.isEmpty(articleId)) {
observable = RetrofitManager.getInstance(context).getApi().postVoteCommunityArticleComment(articleCommunityId, articleId, commentId);
} else if (!TextUtils.isEmpty(questionId)) {
observable = RetrofitManager.getInstance(context).getApi().postVoteQuestionComment(questionId, commentId);
} else {
observable = RetrofitManager.getInstance(context).getApi().postVoteToVideo(videoId, commentId);
}
@ -258,6 +261,28 @@ public class PostCommentUtils {
}
});
}
public static void reportQuestionComment(final Context context,
final String questionId,
final String commentId,
final String reportData,
final PostCommentListener listener) {
RequestBody body = RequestBody.create(MediaType.parse("application/json"), reportData);
RetrofitManager.getInstance(context).getApi()
.postQuestionCommentReport(questionId, commentId, body)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Response<ResponseBody>() {
@Override
public void onResponse(ResponseBody response) {
listener.postSuccess(null);
}
@Override
public void onFailure(HttpException e) {
listener.postFailed(e);
}
});
}
public interface PostCommentListener {
void postSuccess(JSONObject response);