From fee560fa7ece72e638a2edc8b86519c9af588c2d Mon Sep 17 00:00:00 2001 From: fff Date: Sat, 30 Mar 2024 19:18:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=90=8E=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/agconnect-services.json | 70 ++++++++ android/app/build.gradle | 11 +- android/app/proguard-rules.pro | 13 ++ android/gradle.properties | 3 +- android/settings.gradle | 5 +- lib/integral/integral_detailed_page.dart | 2 +- lib/main.dart | 97 +++++++++- lib/main_page.dart | 215 +++++++++-------------- lib/mine/mine_vip/mine_vip_core.dart | 10 +- lib/retrofit/retrofit_api.dart | 9 +- lib/utils/push_event.dart | 9 + 11 files changed, 291 insertions(+), 153 deletions(-) create mode 100644 android/app/agconnect-services.json create mode 100644 lib/utils/push_event.dart diff --git a/android/app/agconnect-services.json b/android/app/agconnect-services.json new file mode 100644 index 00000000..dc54fb1d --- /dev/null +++ b/android/app/agconnect-services.json @@ -0,0 +1,70 @@ +{ + "agcgw":{ + "backurl":"connect-drcn.dbankcloud.cn", + "url":"connect-drcn.hispace.hicloud.com", + "websocketbackurl":"connect-ws-drcn.hispace.dbankcloud.cn", + "websocketurl":"connect-ws-drcn.hispace.dbankcloud.com" + }, + "agcgw_all":{ + "CN":"connect-drcn.hispace.hicloud.com", + "CN_back":"connect-drcn.dbankcloud.cn", + "DE":"connect-dre.hispace.hicloud.com", + "DE_back":"connect-dre.dbankcloud.cn", + "RU":"connect-drru.hispace.hicloud.com", + "RU_back":"connect-drru.dbankcloud.cn", + "SG":"connect-dra.hispace.hicloud.com", + "SG_back":"connect-dra.dbankcloud.cn" + }, + "client":{ + "cp_id":"56568071", + "product_id":"736430079245898772", + "client_id":"682378372344464128", + "client_secret":"23E8E33A66A41E524F393520B1ADD32BE20D071AC6BBD3BFD3A3711B19DF1832", + "project_id":"736430079245898772", + "app_id":"104575849", + "api_key":"CgB6e3x9vFGyCWpfisYh0nwJ+hORXbgXieLZGG4mBDz5pjZB32ahJmqyl49+Qn2noEiMEcvm8jAU42jr3sQmjsXZ", + "package_name":"com.zsw.huixiang" + }, + "oauth_client":{ + "client_id":"104575849", + "client_type":1 + }, + "app_info":{ + "app_id":"104575849", + "package_name":"com.zsw.huixiang" + }, + "service":{ + "analytics":{ + "collector_url":"datacollector-drcn.dt.hicloud.com,datacollector-drcn.dt.dbankcloud.cn", + "resource_id":"p1", + "channel_id":"" + }, + "search":{ + "url":"https://search-drcn.cloud.huawei.com" + }, + "cloudstorage":{ + "storage_url":"https://agc-storage-drcn.platform.dbankcloud.cn" + }, + "ml":{ + "mlservice_url":"ml-api-drcn.ai.dbankcloud.com,ml-api-drcn.ai.dbankcloud.cn" + } + }, + "region":"CN", + "configuration_version":"3.0", + "appInfos":[ + { + "package_name":"com.zsw.huixiang", + "client":{ + "app_id":"104575849" + }, + "app_info":{ + "package_name":"com.zsw.huixiang", + "app_id":"104575849" + }, + "oauth_client":{ + "client_type":1, + "client_id":"104575849" + } + } + ] +} \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 263b2f05..535538f1 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -2,7 +2,8 @@ plugins { id "com.android.application" id "kotlin-android" id "dev.flutter.flutter-gradle-plugin" - id 'com.mob.sdk' + id "com.mob.sdk" +// id "com.huawei.agconnect" } def localProperties = new Properties() @@ -24,9 +25,8 @@ if (flutterVersionName == null) { } def mfph = [ - //宿主包名 "apk.applicationId" : "com.zsw.huixiang", - XG_ACCESS_ID : "1580005689", // 信鸽官网注册所得ACCESS_ID + XG_ACCESS_ID : "1580005689", XG_ACCESS_KEY : "A1HKKUUWI7WI", ] @@ -99,7 +99,10 @@ flutter { } dependencies { -// classpath 'com.mob.sdk:MobSDK:+' + implementation("com.tencent.tpns:xiaomi:1.4.3.6-release") + + implementation("com.tencent.tpns:huawei:1.4.3.6-release") + implementation("com.huawei.hms:push:6.7.0.300") } MobSDK { diff --git a/android/app/proguard-rules.pro b/android/app/proguard-rules.pro index bfaef61f..48bbc46f 100644 --- a/android/app/proguard-rules.pro +++ b/android/app/proguard-rules.pro @@ -59,3 +59,16 @@ # "R.string.mobdemo_authorize_*", # ] #} + +-keep class com.xiaomi.**{*;} +-keep public class * extends com.xiaomi.mipush.sdk.PushMessageReceiver + +-ignorewarnings +-keepattributes *Annotation* +-keepattributes Exceptions +-keepattributes InnerClasses +-keepattributes Signature +-keepattributes SourceFile,LineNumberTable +-keep class com.hianalytics.android.**{*;} +-keep class com.huawei.updatesdk.**{*;} +-keep class com.huawei.hms.**{*;} \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties index 0aab6ea9..9e983a5f 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,5 @@ org.gradle.jvmargs=-Xmx4G + android.useAndroidX=true android.enableJetifier=true -MobSDK.spEdition=IZNAO \ No newline at end of file +MobSDK.spEdition=IZNAO diff --git a/android/settings.gradle b/android/settings.gradle index 6fefc05f..210b22f3 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -32,9 +32,10 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" - id "com.android.application" version "7.3.0" apply false - id "org.jetbrains.kotlin.android" version "1.7.10" apply false + id "com.android.application" version "7.4.2" apply false + id "org.jetbrains.kotlin.android" version "1.9.0" apply false id "com.mob.sdk" version "+" apply false +// id "com.huawei.agconnect" version "1.9.0.300" apply false } include ":app" diff --git a/lib/integral/integral_detailed_page.dart b/lib/integral/integral_detailed_page.dart index dd0a1580..fd85ea0e 100644 --- a/lib/integral/integral_detailed_page.dart +++ b/lib/integral/integral_detailed_page.dart @@ -74,7 +74,7 @@ class _IntegralDetailedPage extends State apiService = ApiService(Dio(), context: context, token: value.getString("token")), userInfo = UserInfo.fromJson(jsonDecode(value.getString('user') ?? "")), - queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get",widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :""), + queryDetail(widget.arguments["titleType"] == 1 ? "" : "bill_cate_point_get", widget.arguments["titleType"] == 1 ?"BILL_TYPE_BEAN_ADD" :""), }); } diff --git a/lib/main.dart b/lib/main.dart index ee24e82c..a7ea4ad2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:io'; import 'package:event_bus/event_bus.dart'; @@ -75,6 +76,8 @@ import 'package:huixiang/test_page.dart'; import 'package:huixiang/union/location_map_page.dart'; import 'package:huixiang/union/union_select_city.dart'; import 'package:huixiang/utils/ImgCachePath.dart'; +import 'package:huixiang/utils/native_event_handler.dart'; +import 'package:huixiang/utils/push_event.dart'; import 'package:huixiang/vip/user_vip_service_page.dart'; import 'package:huixiang/web/web_page.dart'; @@ -84,6 +87,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/web/web_turntable_activity.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:tpns_flutter_plugin/tpns_flutter_plugin.dart'; import 'community/community_view/class_details.dart'; import 'community/headlines/headlines_column_details.dart'; @@ -148,12 +152,101 @@ void main() async { // initSdk(); bool? isFirst = sharedPreferences.getBool("isFirst"); + addPushHandler(); + runApp(MyApp(locale, isFirst)); - // FlutterBugly.postCatchedException((){ - // }); + // FlutterBugly.postCatchedException((){}); // FlutterBugly.init(androidAppId: "204f207673",iOSAppId: "8bb92ba0f6"); } +addPushHandler() { + + // if (Platform.isAndroid) { + // xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( + // MyNativeEventHandler((String title, String message, String customContent, int type) { + // print("xgPushClickAction2: $customContent"); + // SharedPreferences.getInstance().then((value) { + // value.setString("pushData", customContent); + // }); + // }, + // ), + // ); + // } + + /// @typed: ARTICLE(1)文章 ACTIVITY(2)活动 SHOP(3)店铺 + /// CREDIT_GOODS(4)积分商品 ORDER(5)订单 TREND(6)动态 MEMBER(7)用户 + /// WALLET(8)平台余额/钱包 WELFARE(9)福利中心 COUPON(12)优惠券列表 + /// CATE_BEAN(13)我的印章 + xgFlutterPlugin.addEventHandler( + onReceiveMessage: (Map event) async { + print("onReceiveMessage: ${event.toString()}"); + return true; + }, + onReceiveNotificationResponse: (Map event) async { + print("onReceiveNotificationResponse: ${event.toString()}"); + try { + if (jsonDecode(event["customMessage"])["typed"] == 6) { + eventBus.fire(PushEvent(1)); + } + } catch (ex) {} + return true; + }, + xgPushClickAction: (Map event) async { + print("xgPushClickAction1: $event"); + if (event["actionType"] == 2) return event; + if (Platform.isAndroid + ? (event["actionType"] == 0) + : (event["xg"]?["msgtype"] == 1) && + event[Platform.isAndroid ? "customMessage" : "custom"] != null) { + SharedPreferences.getInstance().then((value) { + value.setString("pushData", + event[Platform.isAndroid ? "customMessage" : "custom"]); + }); + eventBus.fire(PushEvent(0)); + } + return true; + }, + xgPushDidBindWithIdentifier: (Map event) async { + print("xgPushDidBindWithIdentifier: ${event.toString()}"); + return true; + }, + xgPushDidUnbindWithIdentifier: (Map event) async { + print("xgPushDidUnbindWithIdentifier: ${event.toString()}"); + return true; + }, + xgPushDidUpdatedBindedIdentifier: (Map event) async { + print("xgPushDidUpdatedBindedIdentifier: ${event.toString()}"); + return true; + }, + xgPushDidClearAllIdentifiers: (Map event) async { + print("xgPushDidClearAllIdentifiers: ${event.toString()}"); + return true; + }, + onRegisteredDeviceToken: (String res) async { + print("onRegisteredDeviceToken: ${res}"); + return true; + }, + onRegisteredDone: (String res) async { + print("onRegisteredDone: ${res}"); + return true; + }, + unRegistered: (String res) async { + print("unRegistered: ${res}"); + return true; + }, + xgPushNetworkConnected: (String res) async { + print("xgPushNetworkConnected: ${res}"); + return true; + }, + xgPushDidSetBadge: (String res) async { + print("xgPushDidSetBadge: ${res}"); + return true; + }, + ); + +} + +XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); EventBus eventBus = EventBus(sync: true); Route? lastRoutePage; diff --git a/lib/main_page.dart b/lib/main_page.dart index 825b3cea..a4beb3c4 100644 --- a/lib/main_page.dart +++ b/lib/main_page.dart @@ -24,6 +24,7 @@ import 'package:huixiang/utils/event_type.dart'; import 'package:huixiang/utils/flutter_utils.dart'; import 'package:huixiang/utils/font_weight.dart'; import 'package:huixiang/utils/native_event_handler.dart'; +import 'package:huixiang/utils/push_event.dart'; import 'package:huixiang/view_widget/update_dialog.dart'; import 'package:huixiang/vip/vip_page.dart'; import 'package:package_info_plus/package_info_plus.dart'; @@ -120,6 +121,15 @@ class _MainPage extends State with WidgetsBindingObserver { pushRoute(); + eventBus.on().listen((PushEvent event) { + if (event.eventType == 0) { + pushRoute(); + } else if (event.eventType == 1) { + MinePageState? state = minePageKey.currentState as MinePageState?; + state?.queryMsgStats(); + } + }); + String invite = ""; var interviewCouponList; var firstLoginCouponList; @@ -191,8 +201,6 @@ class _MainPage extends State with WidgetsBindingObserver { appAutoUpdate(); } - final XgFlutterPlugin xgFlutterPlugin = XgFlutterPlugin(); - // Future initPlatformState() async { // String? platformVersion; // try { @@ -214,71 +222,16 @@ class _MainPage extends State with WidgetsBindingObserver { xgFlutterPlugin.setEnableDebug(true); ///此处配置为iOS的appID信息,Android信息在build.gradle文件中 - xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22"); - - // xgFlutterPlugin.addEventHandler( - // onReceiveMessage: (Map event) async { - // print("onReceiveMessage: ${event.toString()}"); - // return true; - // }, - // onReceiveNotificationResponse: (Map event) async { - // print("onReceiveNotificationResponse: ${event.toString()}"); - // return true; - // }, - // xgPushDidBindWithIdentifier: (Map event) async { - // print("xgPushDidBindWithIdentifier: ${event.toString()}"); - // return true; - // }, - // xgPushDidUnbindWithIdentifier: (Map event) async { - // print("xgPushDidUnbindWithIdentifier: ${event.toString()}"); - // return true; - // }, - // xgPushDidUpdatedBindedIdentifier: (Map event) async { - // print("xgPushDidUpdatedBindedIdentifier: ${event.toString()}"); - // return true; - // }, - // xgPushClickAction: (Map event) async { - // print("xgPushClickAction: ${event.toString()}"); - // return true; - // }, - // xgPushDidClearAllIdentifiers: (Map event) async { - // print("xgPushDidClearAllIdentifiers: ${event.toString()}"); - // return true; - // }, - // onRegisteredDeviceToken: (String res) async { - // print("onRegisteredDeviceToken: ${res}"); - // return true; - // }, - // onRegisteredDone: (String res) async { - // print("onRegisteredDone: ${res}"); - // return true; - // }, - // unRegistered: (String res) async { - // print("unRegistered: ${res}"); - // return true; - // }, - // xgPushNetworkConnected: (String res) async { - // print("xgPushNetworkConnected: ${res}"); - // return true; - // }, - // xgPushDidSetBadge: (String res) async { - // print("xgPushDidSetBadge: ${res}"); - // return true; - // }, - // ); + // xgFlutterPlugin.startXg("1680005688", "IYIB3R2XRE22"); + xgFlutterPlugin.startXg("1580005689", "A1HKKUUWI7WI"); if (Platform.isAndroid) { - XgAndroidApi androidApi = xgFlutterPlugin.getXgAndroidApi(); - //小米 - androidApi.setMiPushAppId(appId: "2882303761520050452"); - androidApi.setMiPushAppKey(appKey: "5582005091452"); - - androidApi.enableOtherPush(); - androidApi.regPush(); + XgFlutterPlugin.xgApi.setMiPushAppId(appId: "2882303761520050452"); + XgFlutterPlugin.xgApi.setMiPushAppKey(appKey: "5582005091452"); + XgFlutterPlugin.xgApi.enableOtherPush(); + XgFlutterPlugin.xgApi.regPush(); } - // ===========================TPNS==== - ShareSDKRegister shareSDKRegister = ShareSDKRegister(); shareSDKRegister.setupWechat( "wx3b269e795ed23e5f", @@ -306,78 +259,76 @@ class _MainPage extends State with WidgetsBindingObserver { BMFMapSDK.setCoordType(BMF_COORD_TYPE.BD09LL); } - if (Platform.isAndroid) { - xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( - MyNativeEventHandler( - (String title, String message, String customContent, int type) { - print("xgPushClickAction2: $customContent"); - SharedPreferences.getInstance().then((value) { - value.setString("pushData", customContent); - }); - }, - ), - ); - } - - /// @typed: ARTICLE(1)文章 ACTIVITY(2)活动 SHOP(3)店铺 CREDIT_GOODS(4)积分商品 ORDER(5)订单 TREND(6)动态 MEMBER(7)用户 WALLET(8)平台余额/钱包 WELFARE(9)福利中心 COUPON(12)优惠券列表 CATE_BEAN(13)我的印章 - xgFlutterPlugin.addEventHandler(xgPushClickAction: (event) async { - print("xgPushClickAction1: $event"); - if (event["actionType"] == 2) return event; - if (Platform.isAndroid - ? (event["actionType"] == 0) - : (event["xg"]["msgtype"] == 1) && - event[Platform.isAndroid ? "customMessage" : "custom"] != null) { - SharedPreferences.getInstance().then((value) { - value.setString("pushData", - event[Platform.isAndroid ? "customMessage" : "custom"]); - }); - if ((ModalRoute.of(context)?.isActive ?? false) - && (ModalRoute.of(context)?.isCurrent ?? false)) { - pushRoute(); - } else { - Navigator.of(context) - .pushNamedAndRemoveUntil('/router/main_page', (route) => false); - } - } - return event; - }, onReceiveNotificationResponse: (event) async { - try { - if (jsonDecode(event["customMessage"])["typed"] == 6) { - // HomePageState state = homePageKey.currentState; - // state.queryMsgStats(); - MinePageState state = minePageKey.currentState as MinePageState; - state.queryMsgStats(); - } - } catch (ex) {} - print("onReceiveNotificationResponse: ${event.toString()}"); - return event; - }, onReceiveMessage: (event) async { - print("onReceiveMessage: ${event.toString()}"); - return event; - }, onRegisteredDone: (event) async { - print("onRegisteredDone: ${event.toString()}"); - return event; - }, xgPushDidBindWithIdentifier: (event) async { - print("xgPushDidBindWithIdentifier: ${event.toString()}"); - return event; - }); + // if (Platform.isAndroid) { + // xgFlutterPlugin.getXgAndroidApi().addNativeEventHandler( + // MyNativeEventHandler( + // (String title, String message, String customContent, int type) { + // print("xgPushClickAction2: $customContent"); + // SharedPreferences.getInstance().then((value) { + // value.setString("pushData", customContent); + // }); + // }, + // ), + // ); + // } + /// @typed: ARTICLE(1)文章 ACTIVITY(2)活动 SHOP(3)店铺 + /// CREDIT_GOODS(4)积分商品 ORDER(5)订单 TREND(6)动态 MEMBER(7)用户 + /// WALLET(8)平台余额/钱包 WELFARE(9)福利中心 COUPON(12)优惠券列表 + /// CATE_BEAN(13)我的印章 + // xgFlutterPlugin.addEventHandler(xgPushClickAction: (event) async { + // print("xgPushClickAction1: $event"); + // if (event["actionType"] == 2) return event; + // if (Platform.isAndroid + // ? (event["actionType"] == 0) + // : (event["xg"]?["msgtype"] == 1) && + // event[Platform.isAndroid ? "customMessage" : "custom"] != null) { + // SharedPreferences.getInstance().then((value) { + // value.setString("pushData", + // event[Platform.isAndroid ? "customMessage" : "custom"]); + // }); + // if ((ModalRoute.of(context)?.isActive ?? false) + // && (ModalRoute.of(context)?.isCurrent ?? false)) { + // pushRoute(); + // } else { + // Navigator.of(context).pushNamedAndRemoveUntil( + // '/router/main_page', + // (route) => false, + // ); + // } + // } + // return event; + // }, onReceiveNotificationResponse: (event) async { + // try { + // if (jsonDecode(event["customMessage"])["typed"] == 6) { + // // HomePageState state = homePageKey.currentState; + // // state.queryMsgStats(); + // MinePageState state = minePageKey.currentState as MinePageState; + // state.queryMsgStats(); + // } + // } catch (ex) {} + // print("onReceiveNotificationResponse: ${event.toString()}"); + // return event; + // }, onReceiveMessage: (event) async { + // print("onReceiveMessage: ${event.toString()}"); + // return event; + // }, onRegisteredDone: (event) async { + // print("onRegisteredDone: ${event.toString()}"); + // return event; + // }, xgPushDidBindWithIdentifier: (event) async { + // print("xgPushDidBindWithIdentifier: ${event.toString()}"); + // return event; + // }); } pushRoute() async { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); if (sharedPreferences.getString("token") == null || sharedPreferences.getString("token") == "") return; - String? startIntent; // if (Platform.isAndroid) startIntent = await Bridge.getStartIntent(); - print("intent:${startIntent}"); - String pushData = ""; - if (startIntent != null && startIntent != "") { - pushData = startIntent; - // pushData = """{"typed":1,"info":"1420304936817655808"}"""; - } else { - pushData = sharedPreferences.getString("pushData") ?? ""; - } - if (pushData == "") return; + String pushData = sharedPreferences.getString("pushData") ?? ""; + print("intent:${pushData}"); + + if (pushData.isEmpty) return; Map pushMap = jsonDecode(pushData); String routeName = ""; Map params = {}; @@ -437,10 +388,10 @@ class _MainPage extends State with WidgetsBindingObserver { } sharedPreferences.setString("pushData", ""); print("xgPushClickAction: routeName: $routeName"); - if (routeName != "") { + if (routeName.isNotEmpty) { Navigator.of(context).pushNamed(routeName, arguments: params); } - } + } queryUserInfo() async { SharedPreferences sharedPreferences = await SharedPreferences.getInstance(); @@ -450,7 +401,9 @@ class _MainPage extends State with WidgetsBindingObserver { Dio(), context: context, token: sharedPreferences.getString('token') ?? "", - ).queryInfo().catchError((onError) {}); + ).queryInfo().catchError((error) { + print("error: ${error}"); + }); sharedPreferences.setString('user', jsonEncode(baseDate.data)); //用户登录时,注册推送的标识是手机号 diff --git a/lib/mine/mine_vip/mine_vip_core.dart b/lib/mine/mine_vip/mine_vip_core.dart index 6be28bce..129b588a 100644 --- a/lib/mine/mine_vip/mine_vip_core.dart +++ b/lib/mine/mine_vip/mine_vip_core.dart @@ -109,8 +109,7 @@ class _MineVipCore extends State { ///会员等级列表 queryVipLevel() async { - BaseData>? rankData = - await apiService?.rankList().catchError((onError) { + BaseData>? rankData = await apiService?.rankList().catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); }); @@ -136,8 +135,7 @@ class _MineVipCore extends State { ///会员权益列表 queryBenefitList() async { - BaseData>? baseData = - await apiService?.benefitList().catchError((onError) { + BaseData>? baseData = await apiService?.benefitList().catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); }); @@ -155,8 +153,8 @@ class _MineVipCore extends State { ///会员权益介绍/规则/说明/储值说明 queryRuleDetails() async { - BaseData? baseData = - await apiService?.vipBenefit().catchError((onError) { + BaseData? baseData = await apiService?.vipBenefit() + .catchError((onError) { refreshController.refreshFailed(); refreshController.loadFailed(); }); diff --git a/lib/retrofit/retrofit_api.dart b/lib/retrofit/retrofit_api.dart index decfb0a1..bf8a148a 100644 --- a/lib/retrofit/retrofit_api.dart +++ b/lib/retrofit/retrofit_api.dart @@ -176,14 +176,11 @@ abstract class ApiService { ///文件上传 @POST("/file/upload") @MultiPart() - Future> upload(@Part(name: "file") File data, - @Part(name: "folderId") int folderId, bool isVideo); + Future> upload(@Part(name: "file") File data, @Part(name: "folderId") int folderId, bool isVideo); /// 周边搜索 - @GET( - "https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") - Future searchPoi(@Path("lat") String lat, @Path("lng") String lng, - @Path("keywords") String keywords, int size, int page); + @GET("https://restapi.amap.com/v3/place/around?key=542b46afa8e4b88fe1eb3c4d0ba0872f&location={lat},{lng}&keywords={keywords}&offset={size}&page={page}&extensions=all") + Future searchPoi(@Path("lat") String lat, @Path("lng") String lng, @Path("keywords") String keywords, int size, int page); /// 用户登录 @POST("/auth/platform/memberLogin") diff --git a/lib/utils/push_event.dart b/lib/utils/push_event.dart new file mode 100644 index 00000000..565d23a0 --- /dev/null +++ b/lib/utils/push_event.dart @@ -0,0 +1,9 @@ + + +class PushEvent { + + PushEvent(this.eventType); + + int eventType; + +} \ No newline at end of file