【光环助手V5.9.0】新社区7期-内容(帖子、视频帖、提问帖)详情页优化(1) https://git.shanqu.cc/pm/halo-app-issues/-/issues/1795
This commit is contained in:
@ -151,6 +151,43 @@ public class PostCommentUtils {
|
||||
});
|
||||
}
|
||||
|
||||
public static void unLikeComment(
|
||||
String articleId,
|
||||
String articleCommunityId,
|
||||
String videoId,
|
||||
String questionId,
|
||||
final String commentId,
|
||||
final PostCommentListener listener) {
|
||||
Observable<ResponseBody> observable;
|
||||
|
||||
if (!TextUtils.isEmpty(questionId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postUnVoteQuestionComment(questionId, commentId);
|
||||
} else if (!TextUtils.isEmpty(articleCommunityId) && !TextUtils.isEmpty(articleId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postUnVoteArticleComment(articleCommunityId, articleId, commentId);
|
||||
} else {
|
||||
observable = RetrofitManager.getInstance().getApi().postUnVoteVideoComment(videoId, commentId);
|
||||
}
|
||||
observable
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Response<ResponseBody>() {
|
||||
@Override
|
||||
public void onResponse(ResponseBody response) {
|
||||
if (listener != null) {
|
||||
listener.postSuccess(null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(HttpException e) {
|
||||
if (listener != null) {
|
||||
listener.postFailed(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public static void addCommentVote(final String commentId,
|
||||
final PostCommentListener listener) {
|
||||
RetrofitManager.getInstance().getApi()
|
||||
@ -260,10 +297,11 @@ public class PostCommentUtils {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static void reportQuestionComment(final String questionId,
|
||||
final String commentId,
|
||||
final String reportData,
|
||||
final PostCommentListener listener) {
|
||||
final String commentId,
|
||||
final String reportData,
|
||||
final PostCommentListener listener) {
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"), reportData);
|
||||
RetrofitManager.getInstance().getApi()
|
||||
.postQuestionCommentReport(questionId, commentId, body)
|
||||
|
||||
Reference in New Issue
Block a user