diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java index 6cc49f0937..550e484202 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XBaseViewHolder.java @@ -99,10 +99,10 @@ public abstract class V2XBaseViewHolder */ public void triggerReportErr(MarkerExploreWay noveltyInfo) { try { - RoadConditionUtils.sendDataErrorReceiverInfo( + RoadConditionUtils.sendShareReceiverInfo( noveltyInfo.getPoiType(), noveltyInfo.getInfoId(), - "1"); + 3); TrackUtils.trackV2xRoadEvent( noveltyInfo.getInfoId(), @@ -120,10 +120,10 @@ public abstract class V2XBaseViewHolder */ public void triggerReportTrue(MarkerExploreWay noveltyInfo) { try { - RoadConditionUtils.sendDataErrorReceiverInfo( + RoadConditionUtils.sendShareReceiverInfo( noveltyInfo.getPoiType(), noveltyInfo.getInfoId(), - "2"); + 2); TrackUtils.trackV2xRoadEvent( noveltyInfo.getInfoId(), diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java index 934ce73686..22ee1d2379 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/adapter/holder/V2XIllegalParkVH.java @@ -109,10 +109,10 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder { */ private void roadReportTrue() { if (mExploreWay != null) { - RoadConditionUtils.sendDataErrorReceiverInfo( + RoadConditionUtils.sendShareReceiverInfo( mExploreWay.getPoiType(), mExploreWay.getInfoId(), - "2"); + 2); } delayedCloseWindow(); } @@ -122,10 +122,10 @@ public class V2XIllegalParkVH extends V2XBaseViewHolder { */ private void roadReportErr() { if (mExploreWay != null) { - RoadConditionUtils.sendDataErrorReceiverInfo( + RoadConditionUtils.sendShareReceiverInfo( mExploreWay.getPoiType(), mExploreWay.getInfoId(), - "1"); + 3); } delayedCloseWindow(); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java index a45cd154c6..e16286b408 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XApiService.java @@ -1,17 +1,15 @@ package com.mogo.module.v2x.network; import com.mogo.commons.data.BaseData; -import com.mogo.module.common.entity.MarkerCardResult; import com.mogo.module.common.entity.MarkerResponse; -import com.mogo.module.v2x.entity.net.V2XUserInfoRes; import com.mogo.module.v2x.entity.net.V2XDemoUserInfoRes; import com.mogo.module.v2x.entity.net.V2XLiveCarRes; import com.mogo.module.v2x.entity.net.V2XLivePushVoRes; import com.mogo.module.v2x.entity.net.V2XSeekHelpRes; import com.mogo.module.v2x.entity.net.V2XStrategyPushRes; +import com.mogo.module.v2x.entity.net.V2XUserInfoRes; import com.mogo.module.v2x.entity.panel.ShareEventDescription; import com.mogo.module.v2x.entity.panel.ShareEventItem; -import com.mogo.module.v2x.entity.panel.SurroundingResponse; import java.util.Map; @@ -23,7 +21,6 @@ import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; import retrofit2.http.Headers; import retrofit2.http.POST; -import retrofit2.http.Query; /** * @author congtaowang @@ -113,19 +110,24 @@ public interface V2XApiService { @POST("/yycp-launcherSnapshot/launcherSnapshot/queryIllegalPark") Observable queryIllegalPark(@FieldMap Map parameters); - /* - * 我的分享-热心指数等 - * */ + /** + * 我的分享-热心指数等 + */ @FormUrlEncoded @POST("/deva/poiInfoFabulous/car/poi/no/queryEnthusiasmIndex/v1") Observable getEnthusiasmIndex(@FieldMap Map parames); - /* - * 我的分享-列表 - * */ + /** + * 我的分享-列表 + */ @FormUrlEncoded @POST("/deva/car/pathAndPoi/no/queryInfo") Observable getShareEventList(@FieldMap Map parames); - + /** + * 点赞接口 + */ + @FormUrlEncoded + @POST("/deva/poiInfoFabulous/car/poi/no/addPoiInfoFabulous/v1") + Observable addPoiInfoFabulous(@FieldMap Map params); } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java index a6b34d8c29..7592319e17 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/network/V2XRefreshModel.java @@ -28,6 +28,7 @@ import com.mogo.utils.network.utils.GsonUtil; import java.util.HashMap; import java.util.Map; + import io.reactivex.android.schedulers.AndroidSchedulers; import io.reactivex.schedulers.Schedulers; import okhttp3.RequestBody; @@ -473,4 +474,49 @@ public class V2XRefreshModel { }); } } + + /** + * 点赞接口 + */ + public void addPoiInfoFabulous(V2XRefreshCallback callback, + String infoId, + String poiType, + int likeOrDislike) { + if (mV2XApiService != null) { + final Map map = new ParamsProvider.Builder(mContext).build(); + String json = new StringBuilder() + .append("{") + .append("\"infoId\":").append(infoId) + .append(",") + .append("\"poiType\":").append(poiType) + .append(",") + .append("\"likeOrdislike\":").append(likeOrDislike) + .append(",") + .append("\"sn\":").append(Utils.getSn()) + .append("}").toString(); + map.put("data", json); + mV2XApiService.addPoiInfoFabulous(map).subscribeOn(Schedulers.io()) + .observeOn(AndroidSchedulers.mainThread()) + .subscribe(new SubscribeImpl(RequestOptions.create(mContext)) { + @Override + public void onSuccess(BaseData o) { + super.onSuccess(o); + if (callback != null) { + callback.onSuccess(o); + } + } + + @Override + public void onError(String message, int code) { + super.onError(message, code); + if (callback != null) { + if (TextUtils.isEmpty(message)) { + message = "网络错误,请稍后重试"; + } + callback.onFail(message); + } + } + }); + } + } } diff --git a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/RoadConditionUtils.java b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/RoadConditionUtils.java index 09e6941de4..80ccde5f77 100644 --- a/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/RoadConditionUtils.java +++ b/modules/mogo-module-v2x/src/main/java/com/mogo/module/v2x/utils/RoadConditionUtils.java @@ -1,13 +1,8 @@ package com.mogo.module.v2x.utils; -import android.content.Intent; - import com.mogo.commons.voice.AIAssist; -import com.mogo.module.common.entity.V2XPoiTypeEnum; +import com.mogo.module.v2x.V2XServiceManager; import com.mogo.utils.TipToast; -import com.mogo.utils.logger.Logger; - -import static com.mogo.module.v2x.V2XConst.MODULE_NAME; /** * author : donghongyu @@ -17,69 +12,21 @@ import static com.mogo.module.v2x.V2XConst.MODULE_NAME; * version: 1.0 */ public class RoadConditionUtils { - /** - * 向探路模块发送消息正确的确认广播 - * - * @param poiType 当前poi信息 - */ - public static void sendShareReceiverInfo(String poiType) { - if (poiType != null) { - switch (poiType) { - case V2XPoiTypeEnum.FOURS_BLOCK_UP: - sendShareReceiver("1"); - break; - case V2XPoiTypeEnum.TRAFFIC_CHECK: - sendShareReceiver("2"); - break; - case V2XPoiTypeEnum.ROAD_CLOSED: - sendShareReceiver("3"); - break; - } - } - } /** - * 向探路模块发送数据纠错广播 - * - * @param poiType 当前poi信息 + * 提交网络 */ - public static void sendDataErrorReceiverInfo(String poiType, String infoId, String updateType) { - sendDataErrorReceiver(infoId, poiType, updateType); - } - - - /** - * 发送广播 type: 1拥堵,2交通检查,3封路 - */ - public static void sendShareReceiver(String type) { - Intent intent = new Intent(); - intent.setAction("com.zhidao.roadcondition.share"); - intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); - intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); - intent.putExtra("type", type); - V2XUtils.getApp().sendBroadcast(intent); - Logger.d(MODULE_NAME, "通过广播通知探路正确。。。"); - } - - /** - * 数据错误 - * - * @param id 事件ID - * @param poiType 事件类型 - */ - public static void sendDataErrorReceiver(String id, String poiType, String updateType) { + public static void sendShareReceiverInfo(String infoId, + String poiType, + int likeOrDislike) { showTip(); - - Intent intent = new Intent(); - intent.setAction("com.zhidao.tanlu.dataerror"); - intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND); - intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); - intent.putExtra("id", id); - intent.putExtra("type", poiType); - intent.putExtra("updateType", updateType); - V2XUtils.getApp().sendBroadcast(intent); - Logger.d(MODULE_NAME, "通过广播通知探路纠错:id = " + id + " poiType = " + poiType + " updateType = " + updateType); - sendShareReceiverInfo(poiType); + V2XServiceManager + .getV2XRefreshModel() + .addPoiInfoFabulous( + null, + infoId, + poiType, + likeOrDislike); } /** diff --git a/modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_default_black_logo.png b/modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_default_black_logo.png index 7de128bacc..5480b6d165 100644 Binary files a/modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_default_black_logo.png and b/modules/mogo-module-v2x/src/main/res/drawable-ldpi/icon_default_black_logo.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/icon_default_black_logo.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/icon_default_black_logo.png index f238846f9f..e02a57044f 100644 Binary files a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/icon_default_black_logo.png and b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi-1920x1000/icon_default_black_logo.png differ diff --git a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_default_black_logo.png b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_default_black_logo.png index f238846f9f..e02a57044f 100644 Binary files a/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_default_black_logo.png and b/modules/mogo-module-v2x/src/main/res/drawable-xhdpi/icon_default_black_logo.png differ diff --git a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml index 22106657c8..cce3e0668c 100644 --- a/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml +++ b/modules/mogo-module-v2x/src/main/res/layout/item_v2x_event_detail.xml @@ -14,7 +14,7 @@ android:id="@+id/rlRoadEventImg" android:layout_width="wrap_content" android:layout_height="match_parent" - android:background="#5E6079" + android:background="#555A75" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" @@ -24,7 +24,6 @@ android:id="@+id/ivEventImg" android:layout_width="@dimen/module_v2x_event_image_width" android:layout_height="@dimen/module_v2x_event_image_height" - android:background="#5E6079" android:scaleType="center" app:miv_failureHolder="@drawable/icon_default_black_logo" app:miv_overlayImageId="@drawable/icon_default_black_logo"