粗略完成新问题详情页面
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user