From 14de918a79943e4961b09fa01ed320c6cad41f2e Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期三, 28 六月 2023 17:14:51 +0800 Subject: [PATCH] Revert "Revert "Merge branch 'hxb' into wjc"" --- app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java | 85 +++++++++++++++++++++++------------------- 1 files changed, 46 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java index 2d35ae6..1bc3474 100644 --- a/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java +++ b/app/src/main/java/com/hdl/photovoltaic/uni/HDLUniMP.java @@ -1,6 +1,5 @@ package com.hdl.photovoltaic.uni; -import androidx.annotation.NonNull; import com.google.gson.Gson; @@ -15,45 +14,64 @@ /*********UniMP wgt id*********/ public final static String UNI_APP_ID = "__UNI__A2E7300";//鍏変紡wgt鍖呭皬绋嬪簭id - /*********UniMP Event 鍘熺敓鍜屽皬绋嬪簭浜や簰 鑷畾涔夐�氱煡浜嬩欢*********/ public final static String UNI_EVENT_uniMPOnClose = "uni_MPOnClose";//鑷畾涔夊皬绋嬪簭鍏抽棴浜嬩欢 - public final static String UNI_EVENT_GetAppParams = "uni_GetAppParams";//鑾峰彇APP搴旂敤淇℃伅 - //銆愬皬绋嬪簭銆戝彂閫佸埌銆愬師鐢熴�� 鍔犲墠缂�:uni_ + + //region --------銆愬皬绋嬪簭銆戝彂閫佸埌銆愬師鐢熴��(鍔犲墠缂�:uni_)-------- /*********浣忓畢銆愮數绔欍�戞ā鍧�*********/ - public final static String UNI_EVENT_HOME_LIST = "list";//鑾峰彇浣忓畢銆愮數绔欍�戝垪琛� - public final static String UNI_EVENT_HOME_CREATION = "creation";//浣忓畢銆愮數绔欍�戝垱寤� - public final static String UNI_EVENT_HOME_EDIT = "edit";//浣忓畢銆愮數绔欍�戠紪杈� - public final static String UNI_EVENT_HOME_DETAILS = "details";//浣忓畢銆愮數绔欍�戣鎯� - public final static String UNI_EVENT_Home_DEl = "del";//浣忓畢銆愮數绔欍�戝垹闄� + public final static String UNI_EVENT_REPLY_HOME_MODEL = "uni_home_model";//浣忓畢妯″潡 + public final static String UNI_EVENT_REPLY_HOME_LIST = "list";//鑾峰彇浣忓畢銆愮數绔欍�戝垪琛� + public final static String UNI_EVENT_REPLY_HOME_CREATION = "creation";//浣忓畢銆愮數绔欍�戝垱寤� + public final static String UNI_EVENT_REPLY_HOME_EDIT = "edit";//浣忓畢銆愮數绔欍�戠紪杈� + public final static String UNI_EVENT_REPLY_HOME_DETAILS = "details";//浣忓畢銆愮數绔欍�戣鎯� + public final static String UNI_EVENT_REPLY_Home_DEl = "del";//浣忓畢銆愮數绔欍�戝垹闄� /*********璁惧妯″潡*********/ - public final static String UNI_EVENT_DEVICE_LIST = "list";//閫嗗彉鍣ㄨ澶囧垪琛� - public final static String UNI_EVENT_DEVICE_CHILD_LIST = "child_list";//閫嗗彉鍣ㄣ�愪笅鎸傘�戣澶囧垪琛� - public final static String UNI_EVENT_DEVICE_ADD = "add";//璁惧娣诲姞 - public final static String UNI_EVENT_DEVICE_DEL = "del";//璁惧鍒犻櫎 - public final static String UNI_EVENT_DEVICE_OID = "oid";//璁惧銆愬寘鎷笅鎸傝澶囥�憃id鍒楄〃 + public final static String UNI_EVENT_REPLY_DEVICE_MODEL = "uni_device_model";//璁惧妯″潡 + public final static String UNI_EVENT_REPLY_DEVICE_LIST = "list";//閫嗗彉鍣ㄨ澶囧垪琛� + public final static String UNI_EVENT_REPLY_DEVICE_CHILD_LIST = "child_list";//閫嗗彉鍣ㄣ�愪笅鎸傘�戣澶囧垪琛� + public final static String UNI_EVENT_REPLY_DEVICE_ADD = "add";//璁惧娣诲姞 + public final static String UNI_EVENT_REPLY_DEVICE_DEL = "del";//璁惧鍒犻櫎 + public final static String UNI_EVENT_REPLY_DEVICE_OID = "oid";//璁惧銆愬寘鎷笅鎸傝澶囥�憃id鍒楄〃 + public final static String UNI_EVENT_REPLY_DEVICE_MODBUS_SEND="modbus_send";//modbus鍗忚 + /*********Wifi妯″潡*********/ //鍗敠瀹氫箟 + public final static String UNI_EVENT_REPLY_WIFI_MODEL = "uni_wifi_model";//wifi妯″潡 + public final static String UNI_EVENT_REPLY_WIFI_LIST = "list";//鑾峰彇wifi鍒楄〃 + public final static String UNI_EVENT_REPLY_WIFI_INFO = "info";//鑾峰彇褰撳墠wifi淇℃伅 + public final static String UNI_EVENT_REPLY_WIFI_CONNECT = "connect";//杩炴帴wifi + //endregion - //銆愬師鐢熴�戜富鍔ㄥ彂閫佸埌銆愬皬绋嬪簭銆� 鍔犲墠缂�:app_ + //region --------銆愬師鐢熴�戜富鍔ㄥ彂閫佸埌銆愬皬绋嬪簭銆�-------- + public final static String UNI_EVENT_NOTIFICATION_DEVICE_MODEL = "uni_notification_model";//閫氱煡妯″潡 + public final static String UNI_EVENT_NOTIFICATION_DEVICE_LIST = "list";//閫嗗彉鍣ㄨ澶囧垪琛� + public final static String UNI_EVENT_NOTIFICATION_DEVICE_CHILD_LIST = "child_list";//閫嗗彉鍣ㄣ�愪笅鎸傘�戣澶囧垪琛� + public final static String UNI_EVENT_NOTIFICATION_DEVICE_ADD = "add";//璁惧娣诲姞 + public final static String UNI_EVENT_NOTIFICATION_DEVICE_DEL = "del";//璁惧鍒犻櫎 + public final static String UNI_EVENT_NOTIFICATION_DEVICE_OID = "oid";//璁惧銆愬寘鎷笅鎸傝澶囥�憃id鍒楄〃 + //endregion - //銆愬師鐢熴�戞墦寮�銆愬皬绋嬪簭銆戦〉闈㈣矾寰�:open_ -// public final static String UNI_EVENT_HOME_CREATION = "creation";//浣忓畢銆愮數绔欍�戝垱寤� -// public final static String UNI_EVENT_HOME_EDIT = "edit";//浣忓畢銆愮數绔欍�戠紪杈� -// public final static String UNI_EVENT_HOME_DETAILS = "details";//浣忓畢銆愮數绔欍�戣鎯� -// public final static String UNI_EVENT_Home_DEl = "del";//浣忓畢銆愮數绔欍�戝垹闄� + //region --------銆愬師鐢熴�戞墦寮�銆愬皬绋嬪簭銆戦〉闈㈣矾寰�(UNI_EVENT_OPEN_HOME_CREATION+?key=value&key=鍙傛暟涓�)-------- + /*********浣忓畢妯″潡*********/ + public final static String UNI_EVENT_OPEN_HOME_CREATION = "pages/powerStation/powerStationCreate";//浣忓畢銆愮數绔欍�戝垱寤� + public final static String UNI_EVENT_OPEN_HOME_EDIT = "pages/powerStation/powerStationEdit";//浣忓畢銆愮數绔欍�戠紪杈� + public final static String UNI_EVENT_OPEN_HOME_DETAILS = "pages/powerStationDetail/index";//浣忓畢銆愮數绔欍�戣鎯� + public final static String UNI_EVENT_OPEN_HOME_DEl = "del";//浣忓畢銆愮數绔欍�戝垹闄� + /*********璁惧妯″潡*********/ + //璁惧妯″潡鎵撳紑椤甸潰鍏ㄨ矾寰� + //endregion /** * 灏忕▼搴忎笌鍘熺敓閫氳鏁版嵁鏍煎紡 - * 鑷畾涔夋牸寮� + * 鑷畾涔夋暟鎹牸寮� */ public static class UniCallBackBaseBean implements Serializable { + private String path;//鎵撳紑灏忕▼搴忚矾寰�(鏆傛椂鐢ㄤ笉涓�) private String code;//鐘舵�佺爜 private String mes;//淇℃伅鎻忚堪 - private String topic;//鏆傛椂鐢ㄤ笉涓� private String type;//鍔熻兘绫诲瀷 private Object data;//闄勫姞json鏁版嵁 @@ -76,7 +94,6 @@ this.code = code; } - public String getMes() { return mes == null ? "" : mes; } @@ -93,13 +110,6 @@ this.data = data; } - public String getTopic() { - return topic; - } - - public void setTopic(String topic) { - this.topic = topic; - } public String getType() { return type == null ? "" : type; @@ -109,15 +119,12 @@ this.type = type; } - public JSONObject getJSONObject(Object obj) { - Gson gson = new Gson(); - String json = gson.toJson(obj); - com.alibaba.fastjson.JSONObject d=new com.alibaba.fastjson.JSONObject(); - JSONObject jsonObject = gson.fromJson(json, JSONObject.class); - if (jsonObject == null) { - jsonObject = new JSONObject(); - } - return jsonObject; + public String getPath() { + return path == null ? "" : path; + } + + public void setPath(String path) { + this.path = path; } -- Gitblit v1.8.0