opt tanlu and share
This commit is contained in:
@@ -0,0 +1,96 @@
|
||||
package com.mogo.service.share;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
|
||||
/**
|
||||
* 探路情报相关接口
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoTanluProvider extends IProvider {
|
||||
/**
|
||||
* 拥堵
|
||||
*/
|
||||
String TYPE_BLOCK = "10007";
|
||||
/**
|
||||
* 交通检查
|
||||
*/
|
||||
String TYPE_TRAFFIC_CHECK = "10002";
|
||||
/**
|
||||
* 封路
|
||||
*/
|
||||
String TYPE_CLOSURE = "10003";
|
||||
/**
|
||||
* 事故
|
||||
*/
|
||||
String TYPE_ACCIDENT = "10013";
|
||||
/**
|
||||
* 实时路况
|
||||
*/
|
||||
String TYPE_REAL_TIME_TRAFFIC = "10015";
|
||||
/**
|
||||
* 道路积水
|
||||
*/
|
||||
String TYPE_STAGNANT_WATER = "10008";
|
||||
/**
|
||||
* 道路结冰
|
||||
*/
|
||||
String TYPE_ROAD_ICY = "10011";
|
||||
/**
|
||||
* 浓雾
|
||||
*/
|
||||
String TYPE_DENSE_FOG = "10010";
|
||||
/**
|
||||
* 道路施工
|
||||
*/
|
||||
String TYPE_ROAD_CONSTRUCTION = "10006";
|
||||
|
||||
/**
|
||||
* 故障求助
|
||||
*/
|
||||
String TYPE_SEEK_HELP = "9999";
|
||||
|
||||
/**
|
||||
* 用户手点上报
|
||||
*/
|
||||
String UPLOAD_FROM_USER = "2";
|
||||
/**
|
||||
* 用户语音上报
|
||||
*/
|
||||
String UPLOAD_FROM_VOICE = "1";
|
||||
/**
|
||||
* 数据策略:拥堵自动上报
|
||||
*/
|
||||
String UPLOAD_FROM_STRATEGY_BLOCK_AUTO = "3";
|
||||
/**
|
||||
* 数据策略:已有事件云端校验
|
||||
*/
|
||||
String UPLOAD_FROM_STRATEGY_CLOUD_CHECK = "4";
|
||||
/**
|
||||
* 数据策略:交通事故上报
|
||||
*/
|
||||
String UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO = "5";
|
||||
|
||||
/**
|
||||
* 策略上报集合
|
||||
*/
|
||||
String[] STRATEGY_UPLOAD_TYPE_ARRAY = new String[]{UPLOAD_FROM_STRATEGY_BLOCK_AUTO,
|
||||
UPLOAD_FROM_STRATEGY_CLOUD_CHECK, UPLOAD_FROM_STRATEGY_ACCIDENT_AUTO};
|
||||
|
||||
/**
|
||||
* 默认视频抓取时长
|
||||
*/
|
||||
int DEFAULT_VIDEO_DURATION = 10;
|
||||
|
||||
/**
|
||||
* 上传情报
|
||||
*
|
||||
* @param params 情报类型
|
||||
*/
|
||||
void uploadRoadCondition(TanluUploadParams params);
|
||||
|
||||
/**
|
||||
* 开启探路业务服务
|
||||
*/
|
||||
void startTanluService();
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.mogo.service.share;
|
||||
|
||||
import com.alibaba.android.arouter.facade.template.IProvider;
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* 探路相关ui provider
|
||||
*
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public interface IMogoTanluUiProvider extends IProvider {
|
||||
/**
|
||||
* 搜索道路事件接口,当前只在应用在后台时,收到搜索相关唤醒词指令,需跳转前台时使用
|
||||
* @param intentStr action
|
||||
* @param data 思必驰相关事件
|
||||
* @param city 同行者-xx堵不堵-北京
|
||||
* @param keywords 同行者-xx堵不堵-中关村
|
||||
*/
|
||||
void searchRoadCondition(String intentStr, String data, String city, String keywords);
|
||||
|
||||
/**
|
||||
* 分享成功,在界面上绘制分享的poi点,只是用于打点,并且这个点无法点击,所以没有特别详细的信息
|
||||
* @param poiType 事件类型
|
||||
* @param location 事件坐标
|
||||
*/
|
||||
void shareSuccess(String poiType, MogoLatLng location);
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
package com.mogo.service.share;
|
||||
|
||||
import com.mogo.map.MogoLatLng;
|
||||
|
||||
/**
|
||||
* 探路事件上报参数封装
|
||||
* @author tongchenfei
|
||||
*/
|
||||
public class TanluUploadParams {
|
||||
/**
|
||||
* 事件类型
|
||||
*
|
||||
* 参考 {@link IMogoTanluProvider#TYPE_BLOCK}
|
||||
*/
|
||||
private String eventType;
|
||||
/**
|
||||
* 上报类型
|
||||
*
|
||||
* 参考 {@link IMogoTanluProvider#UPLOAD_FROM_USER}
|
||||
*/
|
||||
private String fromType;
|
||||
/**
|
||||
* 视频时长
|
||||
*/
|
||||
private int duration = IMogoTanluProvider.DEFAULT_VIDEO_DURATION;
|
||||
|
||||
/**
|
||||
* 针对策略上报新增字段,用于车辆经过事故事件上报时,记录经过的事故事件id
|
||||
*/
|
||||
private long parentId = 0;
|
||||
/**
|
||||
* 针对策略上报新增字段,用于车辆经过事故事件上报时,记录触发围栏时的经纬度坐标
|
||||
*/
|
||||
private MogoLatLng location = new MogoLatLng(0, 0);
|
||||
|
||||
public TanluUploadParams(String eventType){
|
||||
this(eventType, IMogoTanluProvider.UPLOAD_FROM_USER);
|
||||
}
|
||||
|
||||
public TanluUploadParams(String eventType, String fromType) {
|
||||
if (eventType == null) {
|
||||
eventType = IMogoTanluProvider.TYPE_BLOCK;
|
||||
}
|
||||
if (fromType == null) {
|
||||
fromType = IMogoTanluProvider.UPLOAD_FROM_USER;
|
||||
}
|
||||
this.eventType = eventType;
|
||||
this.fromType = fromType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 针对策略上报新增构造方法,方便传入parentId和location
|
||||
* @param eventType 事件类型
|
||||
* @param fromType 触发类型,是手动还是被动
|
||||
* @param parentId 经过事件id
|
||||
* @param location 触发围栏的坐标
|
||||
*/
|
||||
public TanluUploadParams(String eventType, String fromType, long parentId,
|
||||
MogoLatLng location) {
|
||||
this.eventType = eventType;
|
||||
this.fromType = fromType;
|
||||
this.parentId = parentId;
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getEventType() {
|
||||
return eventType;
|
||||
}
|
||||
|
||||
public void setEventType(String eventType) {
|
||||
this.eventType = eventType;
|
||||
}
|
||||
|
||||
public String getFromType() {
|
||||
return fromType;
|
||||
}
|
||||
|
||||
public void setFromType(String fromType) {
|
||||
this.fromType = fromType;
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
return duration;
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
this.duration = duration;
|
||||
}
|
||||
|
||||
public long getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(long parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public MogoLatLng getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(MogoLatLng location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TanluUploadParams{" +
|
||||
"eventType='" + eventType + '\'' +
|
||||
", fromType='" + fromType + '\'' +
|
||||
", duration=" + duration +
|
||||
", parentId='" + parentId + '\'' +
|
||||
", location=" + location +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user