change the requestDesignativeIntersectionLive result data
This commit is contained in:
@@ -6,6 +6,7 @@ import com.mogo.cloud.live.listener.IRequestLiveListener;
|
||||
import com.mogo.cloud.live.model.BaseData;
|
||||
import com.mogo.cloud.live.model.LivePush;
|
||||
import com.mogo.cloud.live.model.LiveReceive;
|
||||
import com.mogo.cloud.live.model.LiveRoadCamera;
|
||||
import com.mogo.cloud.live.network.LiveApiServer;
|
||||
import com.mogo.cloud.network.NetConstants;
|
||||
import com.mogo.cloud.network.RetrofitFactory;
|
||||
@@ -213,18 +214,18 @@ public class RequestLiveManager {
|
||||
liveApiServer.getDesignativeIntersectionLive(map)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<BaseData<LiveReceive>>() {
|
||||
.subscribe(new Observer<BaseData<LiveRoadCamera>>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull BaseData<LiveReceive> baseData) {
|
||||
public void onNext(@NonNull BaseData<LiveRoadCamera> baseData) {
|
||||
if (requestLiveListener != null && baseData != null) {
|
||||
LiveReceive liveReceive = baseData.result;
|
||||
if (liveReceive != null && liveReceive.getLive() != null) {
|
||||
requestLiveListener.onSuccess(liveReceive.getLive());
|
||||
LiveRoadCamera liveRoadCamera = baseData.result;
|
||||
if (liveRoadCamera != null && liveRoadCamera.getRtmpUrl() != null) {
|
||||
requestLiveListener.onSuccess(liveRoadCamera.getRtmpUrl());
|
||||
} else {
|
||||
requestLiveListener.onError(new Throwable("此路口摄像头暂无直播流"));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.mogo.cloud.live.model;
|
||||
|
||||
public class LiveRoadCamera {
|
||||
|
||||
/**
|
||||
* 摄像头id
|
||||
*/
|
||||
private int id;
|
||||
|
||||
/**
|
||||
* 纬度
|
||||
*/
|
||||
private double lat;
|
||||
|
||||
/**
|
||||
* 经度
|
||||
*/
|
||||
private double lon;
|
||||
|
||||
/**
|
||||
* 直播Url
|
||||
*/
|
||||
private String rtmpUrl;
|
||||
|
||||
/**
|
||||
* 摄像头状态
|
||||
*/
|
||||
private String state;
|
||||
|
||||
public LiveRoadCamera(int id, double lat, double lon, String rtmpUrl, String state) {
|
||||
this.id = id;
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
this.rtmpUrl = rtmpUrl;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public double getLat() {
|
||||
return lat;
|
||||
}
|
||||
|
||||
public void setLat(double lat) {
|
||||
this.lat = lat;
|
||||
}
|
||||
|
||||
public double getLon() {
|
||||
return lon;
|
||||
}
|
||||
|
||||
public void setLon(double lon) {
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
public String getRtmpUrl() {
|
||||
return rtmpUrl;
|
||||
}
|
||||
|
||||
public void setRtmpUrl(String rtmpUrl) {
|
||||
this.rtmpUrl = rtmpUrl;
|
||||
}
|
||||
|
||||
public String getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public void setState(String state) {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "LiveRoadCamera{" +
|
||||
"id=" + id +
|
||||
", lat=" + lat +
|
||||
", lon=" + lon +
|
||||
", rtmpUrl='" + rtmpUrl + '\'' +
|
||||
", state='" + state + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package com.mogo.cloud.live.network;
|
||||
import com.mogo.cloud.live.model.BaseData;
|
||||
import com.mogo.cloud.live.model.CameraStatusModel;
|
||||
import com.mogo.cloud.live.model.LiveReceive;
|
||||
import com.mogo.cloud.live.model.LiveRoadCamera;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@@ -56,7 +57,7 @@ public interface LiveApiServer {
|
||||
* @return {@link BaseData}
|
||||
*/
|
||||
@GET("mec-etl-server/device/unit/camera/live")
|
||||
Observable<BaseData<LiveReceive>> getDesignativeIntersectionLive(@QueryMap Map<String, Object> parameters);
|
||||
Observable<BaseData<LiveRoadCamera>> getDesignativeIntersectionLive(@QueryMap Map<String, Object> parameters);
|
||||
|
||||
/**
|
||||
* 上传摄像头状态
|
||||
|
||||
Reference in New Issue
Block a user