[1.1.2]
[接口定义]
This commit is contained in:
yangyakun
2023-02-25 11:27:20 +08:00
parent f6e749a2ac
commit 03e8de4831
15 changed files with 124 additions and 362 deletions

View File

@@ -1,28 +0,0 @@
package com.mogo.och.bus.passenger.bean.response;
import com.mogo.eagle.core.data.BaseData;
/**
* 网约车小巴路线接口请求响应结果 返回的是对应司机屏的线路信息
*
* @author tongchenfei
*/
public class BusPassengerRoutesResponse extends BaseData {
private BusPassengerRoutesResult data;
public BusPassengerRoutesResult getResult() {
return data;
}
public void setResult(BusPassengerRoutesResult data) {
this.data = data;
}
@Override
public String toString() {
return "OchBusRoutesResponse{" +
"data=" + data +
'}';
}
}

View File

@@ -1,93 +0,0 @@
package com.mogo.och.bus.passenger.bean.response;
import java.util.List;
import java.util.Objects;
/**
* 网约车小巴路线接口返回接口数据封装
*
* @author tongchenfei
*/
public class BusPassengerRoutesResult {
private List<BusPassengerStation> sites;
private int lineId;
private String name; //线路名称
private int lineType; //线路类型0:环形
private String description;
private int status;
private String runningDur; //运营时间
private long taskTime; //线路时间班次
//线路轨迹相关字段
public String csvFileUrl = ""; //轨迹文件下载的cos url默认“”
public String csvFileMd5 = ""; //轨迹文件md5默认“”
public String txtFileUrl = ""; //打点文件下载的cos url默认“”
public String txtFileMd5 = ""; //轨迹文件md5默认“”
public long contrailSaveTime; //上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
public String carModel = ""; //[optional] 车型号如红旗H9默认“”暂不加入校验逻辑、用于人工排查问题
public String csvFileUrlDPQP = ""; //轨迹文件下载的cos url默认“”
public String csvFileMd5DPQP = ""; //轨迹文件md5默认“”
public String txtFileUrlDPQP = ""; //打点文件下载的cos url默认“”
public String txtFileMd5DPQP = ""; //轨迹文件md5默认“”
public long contrailSaveTimeDPQP; //上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
public List<BusPassengerStation> getSites() {
return sites;
}
public int getLineId() {
return lineId;
}
public String getName() {
return name;
}
public int getLineType() {
return lineType;
}
public String getDescription() {
return description;
}
public int getStatus() {
return status;
}
public String getRunningDur() {
return runningDur;
}
@Override
public String toString() {
return "BusPassengerRoutesResult{" +
"sites=" + sites +
", lineId=" + lineId +
", name='" + name + '\'' +
", lineType=" + lineType +
", description='" + description + '\'' +
", status=" + status +
", runningDur='" + runningDur + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BusPassengerRoutesResult that = (BusPassengerRoutesResult) o;
return lineId == that.lineId
&& lineType == that.lineType
&& status == that.status
&& sites.equals(that.sites)
&& name.equals(that.name)
&& runningDur.equals(that.runningDur);
}
@Override
public int hashCode() {
return Objects.hash(sites, lineId, name, lineType, description, status, runningDur);
}
}

View File

@@ -1,173 +0,0 @@
package com.mogo.och.bus.passenger.bean.response;
import java.util.Objects;
/**
* 单个网约车小巴车站信息
*
* @author wangmingjun
*/
public class BusPassengerStation {
private String name;
private String description;
private String cityCode;
private double lon; //高精坐标
private double lat; //高精坐标
private double gcjLon; //高德坐标
private double gcjLat; //高德坐标
private int businessType; //站点类型9:taxi10:bus
private int status;
private int siteId;
private int seq;
private int drivingStatus;//行驶信息0初始值1已经过2当前站3未到站
private int ifStop = 1; // 是否需要停靠、1需要、0不需要 // TODO: 2021/10/19 原来站点里有设计是否需要停靠字段,现设计暂无,默认都需要停靠
private boolean leaving;
public void setName(String name) {
this.name = name;
}
public void setDescription(String description) {
this.description = description;
}
public void setCityCode(String cityCode) {
this.cityCode = cityCode;
}
public void setLon(double lon) {
this.lon = lon;
}
public void setLat(double lat) {
this.lat = lat;
}
public void setBusinessType(int businessType) {
this.businessType = businessType;
}
public void setStatus(int status) {
this.status = status;
}
public void setSiteId(int siteId) {
this.siteId = siteId;
}
public void setSeq(int seq) {
this.seq = seq;
}
public void setDrivingStatus(int drivingStatus) {
this.drivingStatus = drivingStatus;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public String getCityCode() {
return cityCode;
}
public double getGcjLon() {
return gcjLon;
}
public double getGcjLat() {
return gcjLat;
}
public int getBusinessType() {
return businessType;
}
public int getStatus() {
return status;
}
public int getSiteId() {
return siteId;
}
public int getSeq() {
return seq;
}
public int getDrivingStatus() {
return drivingStatus;
}
public double getLon() {
return lon;
}
public double getLat() {
return lat;
}
public void setIfStop(int ifStop) {
this.ifStop = ifStop;
}
public int getIfStop() {
return ifStop;
}
public void setLeaving(boolean leaving) {
this.leaving = leaving;
}
public boolean isLeaving() {
return leaving;
}
@Override
public String toString() {
return "OchBusStation{" +
"name='" + name + '\'' +
", description='" + description + '\'' +
", cityCode='" + cityCode + '\'' +
", lon=" + lon +
", lat=" + lat +
", businessType=" + businessType +
", status=" + status +
", siteId=" + siteId +
", seq=" + seq +
", drivingStatus=" + drivingStatus +
", ifStop=" + ifStop +
", leaving=" + leaving +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BusPassengerStation that = (BusPassengerStation) o;
return Double.compare(that.lon, lon) == 0
&& Double.compare(that.lat, lat) == 0
&& Double.compare(that.gcjLon, gcjLon) == 0
&& Double.compare(that.gcjLat, gcjLat) == 0
&& businessType == that.businessType
&& status == that.status
&& siteId == that.siteId
&& seq == that.seq
&& drivingStatus == that.drivingStatus
&& ifStop == that.ifStop
&& leaving == that.leaving
&& Objects.equals(name, that.name)
&& Objects.equals(cityCode, that.cityCode);
}
@Override
public int hashCode() {
return Objects.hash(name, description, cityCode, lon, lat, gcjLon, gcjLat, businessType, status, siteId, seq, drivingStatus, ifStop, leaving);
}
}

View File

@@ -1,12 +1,10 @@
package com.mogo.och.bus.passenger.bean.response
import com.mogo.eagle.core.data.BaseData
import java.util.*
/**
* @author congtaowang
* @since 2021/3/22
*
* 小巴车运营状态返回参数
*/
data class BusinessStatusResponse(val data: Result?) : BaseData(){
data class Result(

View File

@@ -0,0 +1,15 @@
package com.mogo.och.bus.passenger.bean.response
import com.mogo.eagle.core.data.BaseData
/**
*
*/
data class BusinessTimeResponse(val data: Result?) : BaseData(){
data class Result(
val currentTime: Long?,//当前时间
val startTime: Long?,//订单开始时间
val endTime: Long?,//订单结束时间
)
}

View File

@@ -3,10 +3,6 @@ package com.mogo.och.bus.passenger.bean.response
import com.mogo.eagle.core.data.BaseData
/**
* @author congtaowang
* @since 2021/3/22
*
* 小巴车运营状态返回参数
*/
data class LineInfoResponse(val data: Result?) : BaseData() {
data class Result(

View File

@@ -0,0 +1,24 @@
package com.mogo.och.bus.passenger.bean.response
import com.mogo.eagle.core.data.BaseData
import java.util.*
/**
*
*/
data class LocusResponse(val data: Result?) : BaseData(){
data class Result(
val contrailSaveTime: Long?,//上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
val csvFileUrl: String?,//轨迹文件下载的cos url默认“”
val csvFileMd5: String?,//轨迹文件md5默认“”
val txtFileUrl: String?,//打点文件下载的cos url默认“”
val txtFileMd5: String?,//轨迹文件md5默认“”
val carModel: String?,//[optional] 车型号如红旗H9默认“”暂不加入校验逻辑、用于人工排查问题
val csvFileUrlDPQP: String?,//轨迹文件下载的cos url默认“”
val csvFileMd5DPQP: String?,//轨迹文件md5默认“”
val txtFileUrlDPQP: String?,//打点文件下载的cos url默认“”
val txtFileMd5DPQP: String?,//轨迹文件md5默认“”
val contrailSaveTimeDPQP: Long?,//上传轨迹完成时间戳ms用于MEC本地手动导入轨迹验证时不会被云端轨迹覆盖
)
}

View File

@@ -3,10 +3,7 @@ package com.mogo.och.bus.passenger.bean.response
import com.mogo.eagle.core.data.BaseData
/**
* @author congtaowang
* @since 2021/3/22
*
* 小巴车运营状态返回参数
*/
data class M1DriverLoginStatusResponse(val data: Result?) : BaseData(){
data class Result(

View File

@@ -0,0 +1,24 @@
package com.mogo.och.bus.passenger.bean.response
import com.mogo.eagle.core.data.BaseData
/**
*
*/
data class OrderInfoResponse(val data: Result?) : BaseData() {
data class Result(
val orderNo: String?,//订单id
val sn: String?,//司机sn
val productType: Int?,//车辆类型
val lineId: Long?,//线路id
val lineName: String?,//线路名称
val siteId: Long?,//站点id
val siteName: String?,//站点名称
val wgs84Lat: Long?,//高精地图
val wgs84Lon: Long?,//高精地图
val startTime: Long?,//开始时间
val endTime: Long?,//结束时间
val passengerPhone: String?,//乘客手机号
)
}

View File

@@ -1,12 +1,10 @@
package com.mogo.och.bus.passenger.bean.response
import com.mogo.eagle.core.data.BaseData
import java.util.*
/**
* @author congtaowang
* @since 2021/3/22
*
* 小巴车运营状态返回参数
*/
data class SiteInfoResponse(val data: List<SiteInfo>?) : BaseData(){
data class SiteInfo(
@@ -14,10 +12,10 @@ data class SiteInfoResponse(val data: List<SiteInfo>?) : BaseData(){
val lineName: String?,//线路名称
val siteId: Int?,//线路Id
val siteName: String?,//站点名称
val Wgs84Lon: Double?,
val Wgs84Lat: Double?,
val GcjLon: Double?,
val GcjLat: Double?,
val Wgs84Lon: Double?,//高精坐标
val Wgs84Lat: Double?,//高精坐标
val GcjLon: Double?,//高德坐标
val GcjLat: Double?,//高德坐标
val seq: Double?,
val type: Int?,
)

View File

@@ -1,10 +0,0 @@
package com.mogo.och.bus.passenger.callback;
/**
* @author: wangmingjun
* @date: 2021/10/22
*/
public interface IBusPassegerDriverStatusCallback {
void changeOperationStatus(boolean changeStatus);
void updatePlateNumber(String plateNumber);
}

View File

@@ -1,9 +0,0 @@
package com.mogo.och.bus.passenger.callback;
/**
* @author: wangmingjun
* @date: 2022/3/10
*/
public interface IBusPassengerMapViewCallback {
void onCameraChange(float bearing);
}

View File

@@ -1,16 +0,0 @@
package com.mogo.och.bus.passenger.callback;
import com.mogo.och.bus.passenger.bean.response.BusPassengerStation;
import java.util.List;
/**
* @author: wangmingjun
* @date: 2022/4/6
*/
public interface IBusPassengerRouteLineInfoCallback {
void updateLineInfo(String lineName, String lineDurTime);
void updateStationsInfo(List<BusPassengerStation> stations, int currentStationIndex, boolean isArrived);
void showNoTaskView();
void hideNoTaskView();
}

View File

@@ -5,6 +5,7 @@ import com.mogo.eagle.core.function.call.telematic.CallerTelematicManager.getSer
import com.mogo.cloud.passport.MoGoAiCloudClientConfig
import com.mogo.eagle.core.network.MoGoRetrofitFactory
import com.mogo.och.bus.passenger.bean.response.M1DriverLoginStatusResponse
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse
import com.mogo.och.common.module.biz.constant.OchCommonConst
import com.mogo.och.common.module.biz.network.OchCommonServiceCallback
import com.mogo.och.common.module.biz.network.OchCommonSubscribeImpl
@@ -16,7 +17,8 @@ import com.mogo.och.common.module.biz.network.interceptor.transformTry
object BusPassengerServiceManager {
private var mBusPassengerServiceApi =
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl()).create(PassengerServiceApi::class.java)
MoGoRetrofitFactory.getInstance(OchCommonConst.getBaseUrl())
.create(PassengerServiceApi::class.java)
/**
* 获取Bus司机端的sn
@@ -28,8 +30,6 @@ object BusPassengerServiceManager {
/**
* 查询司机端出车收车状态,以及车牌号
* @param context
* @param callback
*/
@JvmStatic
fun queryDriverOperationStatus(
@@ -43,6 +43,22 @@ object BusPassengerServiceManager {
)
.transformTry()
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverOperationStatus"))
}
/**
* 查询司机端出车收车状态,以及车牌号
*/
@JvmStatic
fun queryOrderInfo(
context: Context,
callback: OchCommonServiceCallback<OrderInfoResponse>?
) {
mBusPassengerServiceApi.queryOrderInfo(
MoGoAiCloudClientConfig.getInstance().serviceAppId,
MoGoAiCloudClientConfig.getInstance().token,
driverAppSn
)
.transformTry()
.subscribe(OchCommonSubscribeImpl(context, callback, "queryDriverOperationStatus"))
}
}

View File

@@ -1,9 +1,13 @@
package com.mogo.och.bus.passenger.net;
import com.mogo.och.bus.passenger.bean.response.BusinessStatusResponse;
import com.mogo.och.bus.passenger.bean.response.BusinessTimeResponse;
import com.mogo.och.bus.passenger.bean.response.LineInfoResponse;
import com.mogo.och.bus.passenger.bean.response.LocusResponse;
import com.mogo.och.bus.passenger.bean.response.M1DriverLoginStatusResponse;
import com.mogo.och.bus.passenger.bean.response.OrderInfoResponse;
import com.mogo.och.bus.passenger.bean.response.SiteInfoResponse;
import com.mogo.eagle.core.data.BaseData;
import io.reactivex.Observable;
import retrofit2.http.GET;
@@ -11,40 +15,59 @@ import retrofit2.http.Header;
import retrofit2.http.Query;
/**
* Created on 2022/3/31
*
* Bus乘客端接口定义
* 包车乘客端接口定义
*/
interface PassengerServiceApi {
/**
* 查询司机端的登陆状态 06
* 01查询司机端的登陆状态 06
*/
@GET("/och-rental-cabin/api/business/v1/driver/loginStatus")
Observable<M1DriverLoginStatusResponse> queryDriverOperationStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
Observable<M1DriverLoginStatusResponse> queryDriverOperationStatus(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
/**
* 查询服务中的订单 08
* 02查询服务中的订单 08
*/
@GET("/och-rental-cabin/api/business/v1/driver/order")
Observable<M1DriverLoginStatusResponse> queryOrderInfo(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
Observable<OrderInfoResponse> queryOrderInfo(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
/**
* 查询所在城市的所有线路 09
* 03查询所在城市的所有线路 09
*/
@GET("/och-rental-cabin/api/business/v1/driver/lineList")
Observable<LineInfoResponse> queryLineList(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
Observable<LineInfoResponse> queryLineList(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
/**
* 查询所选线路的站点 10
* 04查询所选线路的站点 10
*/
@GET("/och-rental-cabin/api/business/v1/driver/siteList")
Observable<SiteInfoResponse> queryLineSiteList(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn, @Query("sn") String lineId);
Observable<SiteInfoResponse> queryLineSiteList(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn, @Query("sn") String lineId);
/**
* 查询车辆服务状态 07
* 05查询车辆服务状态 07
* 轮训查询订单状态和状态流转
*/
@GET("/och-rental-cabin/api/business/v1/driver/businessStatus")
Observable<BusinessStatusResponse> queryBusinessStatus(@Header ("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
Observable<BusinessStatusResponse> queryBusinessStatus(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
/**
* 06结束订单 03
*/
@GET("/och-rental-cabin/api/flow/v1/driver/serviceEnd")
Observable<BaseData> endOrder(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
/**
* 07查询线路的轨迹文件信息 12
* 启动自动驾驶使用
*/
@GET("/och-rental-cabin/api/business/v1/driver/contrail")
Observable<LocusResponse> queryLocusByLineId(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn, @Query("lineId") String lineId);
/**
* 08查询包车业务时间 11
* 倒计时5分钟 消息盒子、倒计时结束弹窗
*/
@GET("/och-rental-cabin/api/business/v1/driver/queryBusinessTime")
Observable<BusinessTimeResponse> queryBusinessTime(@Header("appId") String appId, @Header("ticket") String ticket, @Query("sn") String sn);
}