add server interface
This commit is contained in:
@@ -64,14 +64,7 @@ class NoticeSocketManager {
|
||||
return;
|
||||
}
|
||||
|
||||
//TODO 展示弹框
|
||||
CallerHmiManager.INSTANCE.showNormalBanner(obj);
|
||||
|
||||
// NoticePushData data = new NoticePushData();
|
||||
// data.setImageUrl(obj.getImageUrl());
|
||||
// data.setContent(obj.getContent());
|
||||
// data.setInfoId(obj.getDbId());
|
||||
// CallerHmiManager.INSTANCE.showTrafficBanner(data);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
package com.mogo.eagle.core.function.notice.network;
|
||||
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalDetail;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import retrofit2.http.FieldMap;
|
||||
import retrofit2.http.FormUrlEncoded;
|
||||
import retrofit2.http.GET;
|
||||
import retrofit2.http.POST;
|
||||
import retrofit2.http.QueryMap;
|
||||
|
||||
/**
|
||||
* @author Jing
|
||||
@@ -36,4 +39,12 @@ public interface NoticeApiService {
|
||||
@POST("/deva/accidentInfoManage/policeUpdateTroubleStatus")
|
||||
Observable<BaseData> sendAcceptStatus(@FieldMap Map<String, String> accidentParameters);
|
||||
|
||||
/**
|
||||
* 获取普通公告详情
|
||||
*
|
||||
* @param param
|
||||
* @return
|
||||
*/
|
||||
@GET("/deva/pc/pathAndPoi/getAnnouncementByDbId")
|
||||
Observable<NoticeNormalDetail> getNoticeDetail(@QueryMap Map<String, String> param);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ import com.mogo.cloud.network.NetConstants;
|
||||
import com.mogo.cloud.network.RetrofitFactory;
|
||||
import com.mogo.cloud.passport.MoGoAiCloudClient;
|
||||
import com.mogo.eagle.core.data.BaseData;
|
||||
import com.mogo.eagle.core.data.notice.NoticeNormalDetail;
|
||||
import com.mogo.eagle.core.function.call.hmi.CallerHmiManager;
|
||||
import com.mogo.utils.logger.Logger;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -20,7 +23,7 @@ import io.reactivex.schedulers.Schedulers;
|
||||
* @since: 10/28/21
|
||||
*/
|
||||
public class NoticeNetWorkManager {
|
||||
private String TAG = "AINotice";
|
||||
private String TAG = "NoticeNetWorkManager";
|
||||
private static volatile NoticeNetWorkManager requestNoticeManager;
|
||||
private final NoticeApiService mNoticeApiService;
|
||||
|
||||
@@ -115,4 +118,45 @@ public class NoticeNetWorkManager {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取普通公告的详情
|
||||
*
|
||||
* @param dbId
|
||||
*/
|
||||
public void getNoticeDetail(String dbId) {
|
||||
String sn = MoGoAiCloudClient.getInstance().getAiCloudClientConfig().getSn();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("sn", sn);
|
||||
map.put("infoId", dbId);
|
||||
|
||||
mNoticeApiService.getNoticeDetail(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<NoticeNormalDetail>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull NoticeNormalDetail noticeNormalDetail) {
|
||||
Logger.d(TAG, "onNext ------ ");
|
||||
// CallerHmiManager.INSTANCE.showNormalBanner(noticeNormalDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
Logger.e(TAG, " onError e = " + e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
Logger.d(TAG, "onComplete ------ ");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user