fix apiservice
This commit is contained in:
@ -18,8 +18,6 @@ import rx.Observable;
|
||||
import rx.android.schedulers.AndroidSchedulers;
|
||||
import rx.schedulers.Schedulers;
|
||||
|
||||
import static com.gh.gamecenter.retrofit.RetrofitManager.getComment;
|
||||
|
||||
/**
|
||||
* Created by khy on 2016/11/9.
|
||||
*/
|
||||
@ -31,9 +29,9 @@ public class PostCommentUtils {
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"), content);
|
||||
Observable<ResponseBody> observable;
|
||||
if (commentEntity != null) {
|
||||
observable = getComment().postReplyComment(LoginUtils.getToken(context), commentEntity.getId(), body);
|
||||
observable = RetrofitManager.getInstance(context).getApi().postReplyComment(LoginUtils.getToken(context), commentEntity.getId(), body);
|
||||
} else {
|
||||
observable = RetrofitManager.getComment().postNewsComment(LoginUtils.getToken(context), newsId, body);
|
||||
observable = RetrofitManager.getInstance(context).getApi().postNewsComment(LoginUtils.getToken(context), newsId, body);
|
||||
}
|
||||
observable.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@ -60,7 +58,7 @@ public class PostCommentUtils {
|
||||
|
||||
public static void addCommentVoto(final Context context, final String commentId,
|
||||
final PostCommentListener listener) {
|
||||
getComment()
|
||||
RetrofitManager.getInstance(context).getApi()
|
||||
.postCommentVote(LoginUtils.getToken(context), commentId)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
@ -84,7 +82,7 @@ public class PostCommentUtils {
|
||||
public static void addReportData(final Context context, final String reportData,
|
||||
final PostCommentListener listener) {
|
||||
RequestBody body = RequestBody.create(MediaType.parse("application/json"), reportData);
|
||||
getComment()
|
||||
RetrofitManager.getInstance(context).getApi()
|
||||
.postReportData(body, LoginUtils.getToken(context))
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
|
||||
Reference in New Issue
Block a user