fix: 【光环助手V5.12.0】端内兼容适配短链接(0713测试反馈) https://git.shanqu.cc/pm/halo/halo-app-issues/-/issues/1945
This commit is contained in:
@ -3,6 +3,7 @@ package com.gh.common.util;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.gh.gamecenter.R;
|
||||
import com.gh.gamecenter.common.retrofit.JSONObjectResponse;
|
||||
import com.gh.gamecenter.common.retrofit.Response;
|
||||
@ -10,7 +11,9 @@ import com.gh.gamecenter.entity.CommentEntity;
|
||||
import com.gh.gamecenter.retrofit.RetrofitManager;
|
||||
import com.lightgame.utils.Utils;
|
||||
import com.walkud.rom.checker.RomIdentifier;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
@ -78,8 +81,7 @@ public class PostCommentUtils {
|
||||
Observable<ResponseBody> observable;
|
||||
if (!TextUtils.isEmpty(articleId)) {
|
||||
if (commentEntity != null) {
|
||||
observable = RetrofitManager.getInstance().getApi().postReplyToCommunityArticleComment(articleCommunityId,
|
||||
articleId, commentEntity.getId(), body);
|
||||
observable = RetrofitManager.getInstance().getApi().postReplyToCommunityArticleComment(commentEntity.getId(), body);
|
||||
} else {
|
||||
observable = RetrofitManager.getInstance().getApi().postCommentToCommunityArticle(articleId, body);
|
||||
}
|
||||
@ -121,8 +123,8 @@ public class PostCommentUtils {
|
||||
|
||||
if (!TextUtils.isEmpty(answerId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postVoteAnswerComment(answerId, commentId);
|
||||
} else if (!TextUtils.isEmpty(articleId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postVoteCommunityArticleComment(articleId, commentId);
|
||||
} else if (!TextUtils.isEmpty(commentId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postVoteCommunityArticleComment(commentId);
|
||||
} else if (!TextUtils.isEmpty(questionId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postVoteQuestionComment(questionId, commentId);
|
||||
} else {
|
||||
@ -159,8 +161,8 @@ public class PostCommentUtils {
|
||||
|
||||
if (!TextUtils.isEmpty(questionId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postUnVoteQuestionComment(questionId, commentId);
|
||||
} else if (!TextUtils.isEmpty(articleId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postUnVoteArticleComment(articleId, commentId);
|
||||
} else if (!TextUtils.isEmpty(commentId)) {
|
||||
observable = RetrofitManager.getInstance().getApi().postUnVoteArticleComment(commentId);
|
||||
} else {
|
||||
observable = RetrofitManager.getInstance().getApi().postUnVoteVideoComment(videoId, commentId);
|
||||
}
|
||||
@ -257,7 +259,7 @@ public class PostCommentUtils {
|
||||
final PostCommentListener listener) {
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"), reportData);
|
||||
RetrofitManager.getInstance().getApi()
|
||||
.postCommunityArticleCommentReport(communityId, articleId, commentId, body)
|
||||
.postCommunityArticleCommentReport(commentId, body)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Response<ResponseBody>() {
|
||||
|
||||
Reference in New Issue
Block a user