hxb
2024-06-25 70a4c1baac1415ea65d9727284703a3d5585036d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
package com.hdl.photovoltaic.uni;
 
 
import java.io.Serializable;
 
/**
 * UniMP 原生和小程序交互相关配置参数
 */
public class HDLUniMP {
 
    /*********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应用信息
 
    //region --------【小程序】发送到【原生】--------
 
 
    /*********用户 模块*********/
    public final static String UNI_EVENT_REPLY_USER_MODEL = "uni_user_model";//用户模块(大类)
    public final static String UNI_EVENT_REPLY_USER_INFO = "user_info";//用户信息
    public final static String UNI_EVENT_REPLY_USER_LOCAL_INFO = "user_local_info";//用户本地缓存信息
    public final static String UNI_EVENT_REPLY_USER_IMAGE = "user_image";//用户头像
 
 
    /*********住宅【电站】模块*********/
    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_REPLY_HOME_CLOSE_HOME_DETAILS_PAGE = "close_home_details_page";//关闭详情页
    /*********设备模块*********/
    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_NET_LIST = "net_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_ADD_All = "add_all";//添加多个设备
    public final static String UNI_EVENT_REPLY_DEVICE_DEL = "del";//设备删除
    public final static String UNI_EVENT_REPLY_DEVICE_OID = "oid";//设备【包括下挂设备】oid列表
    public final static String UNI_EVENT_REPLY_DEVICE_TIME = "time";//设备时间读取
    public final static String UNI_EVENT_REPLY_DEVICE_TIME_EDIT = "time_edit";//设备时间编辑
    public final static String UNI_EVENT_REPLY_DEVICE_CLEAR_DATA = "clear_data";//设备清空住宅id
    public final static String UNI_EVENT_REPLY_DEVICE_UPLOADING_DATA = "uploading_data";//设备上传数据
    public final static String UNI_EVENT_REPLY_DEVICE_MODBUS_SEND = "modbus_send";//modbus协议
    public final static String UNI_EVENT_REPLY_DEVICE_Link_edit_SEND = "link_property_edit";//link协议属性编辑
    public final static String UNI_EVENT_REPLY_DEVICE_Link_read_SEND = "link_property_read";//link协议属性读取
    public final static String UNI_EVENT_REPLY_DEVICE_MESSAGE_NUMBER = "message_number";//消息总数量
    public final static String UNI_EVENT_REPLY_DEVICE_DELETE_OID = "delete_Oid";//删除设备oid
    public final static String UNI_EVENT_REPLY_DEVICE_INITIALIZEINVERTER = "initializeInverter";//重置逆变器
    public final static String UNI_EVENT_REPLY_DEVICE_REMOTEINFO = "set_device_remoteInfo";//设置设备远程信息
 
 
    /*********OTA模块*********/
    public final static String UNI_EVENT_REPLY_OTA_MODEL = "uni_ota_model";//升级模块(大类)
    public final static String UNI_EVENT_REPLY_OTA_CLOUD_OID_LIST = "cloud_oid_list";//向云端获取oid列表
    public final static String UNI_EVENT_REPLY_OTA_FIRMWARES_LIST = "firmwares_current_list";//当前设备固件列表
    public final static String UNI_EVENT_REPLY_OTA_FIRMWARES_NEW_LIST = "firmwares_new_list";//设备新固件列表
    public final static String UNI_EVENT_REPLY_OTA_FIRMWARES_LOCAL = "firmwares_local_list";//设备本地固件列表
    public final static String UNI_EVENT_REPLY_OTA_FIRMWARES_DOWNLOAD = "firmwares_download";//设备固件下载
    public final static String UNI_EVENT_REPLY_OTA_FIRMWARES_UPGRADE = "firmwares_upgrade";//设备固件升级
    public final static String UNI_EVENT_REPLY_OTA_DRIVER_LIST = "driver_current_list";//当前设备驱动列表
    public final static String UNI_EVENT_REPLY_OTA_DRIVER_NEW = "driver_new_list";//设备新驱动列表
    public final static String UNI_EVENT_REPLY_OTA_DRIVER_LOCAL = "driver_local_list";//设备本地驱动列表
    public final static String UNI_EVENT_REPLY_OTA_DRIVER_DOWNLOAD = "driver_download";//设备驱动下载
    public final static String UNI_EVENT_REPLY_OTA_DRIVER_UPGRADE = "driver_upgrade";//设备驱动升级
    public final static String UNI_EVENT_REPLY_OTA_CANCEL_UPGRADE = "cancel_upgrade";//设备驱动,固件取消升级
    public final static String UNI_EVENT_REPLY_OTA_DRIVER_CANCEL_DOWNLOAD = "cancel_download";//设备取消下载升级文件
    public final static String UNI_EVENT_REPLY_OTA_OPEN_SERVICE = "open_service";//打开服务
    public final static String UNI_EVENT_REPLY_OTA_CLOSE_SERVICE = "close_service";//关闭服务
 
    /*********其它模块*********/
    public final static String UNI_EVENT_REPLY_OTHER_MODEL = "uni_other_model";//其它模块(大类)
    public final static String UNI_EVENT_REPLY_OTHER_UNIT = "temperature_unit";//获取温度单位
    public final static String UNI_EVENT_REPLY_OTHER_APP_LANGUAGE = "app_language";//获取app语言
    public final static String UNI_EVENT_REPLY_OTHER_LOCATION_INFO = "location_info";//获取app位置信息
    public final static String UNI_EVENT_REPLY_OTHER_UNI_LOG = "uni_log";//收集uni日志
    public final static String UNI_EVENT_REPLY_OTHER_BACK = "back";//首页返回
    public final static String UNI_EVENT_REPLY_OTHER_APPLICATION_CONFLICT = "application_conflict";//应用冲突
    public final static String UNI_EVENT_REPLY_OTHER_LOGOUT = "uni_logout";//退出登录
 
 
    /*********C端【我的】模块*********/
    public final static String UNI_EVENT_REPLY_MINE_MODEL = "uni_mine_model";//我的模块(大类)
    public final static String UNI_EVENT_REPLY_MINE_USER_INFO = "get_user_info";//个人信息获取:
    public final static String UNI_EVENT_REPLY_MINE_EDIT_AVATAR = "edit_avatar";//头像更新
    public final static String UNI_EVENT_REPLY_MINE_EDIT_USER_INFO = "edit_user_info";//资料编辑
    public final static String UNI_EVENT_REPLY_MINE_SELECTED_POWERSTATION = "selected_powerstation";//电站选择
    public final static String UNI_EVENT_REPLY_MINE_MESSAGE_CENTER = "message_center";//消息中心
    public final static String UNI_EVENT_REPLY_MINE_USER_MANAGER = "user_manager";//用户管理
    public final static String UNI_EVENT_REPLY_MINE_ABOUT = "about";//关于
    public final static String UNI_EVENT_REPLY_MINE_SETTING = "setting";//设置
 
 
    /*********Wifi模块*********/
    public final static String UNI_EVENT_REPLY_WIFI_MODEL = "uni_wifi_model";//wifi模块(大类)
    public final static String UNI_EVENT_REPLY_PHONE_WIFI_LIST = "phone_wifi_list";//手机获取wifi列表
    public final static String UNI_EVENT_REPLY_PHONE_WIFI_INFO = "phone_wifi_info";//手机获取当前wifi信息
    public final static String UNI_EVENT_REPLY_PHONE_OPEN_WIFI_SETTINGS = "phone_open_wifi_settings";//调用打开手机Wifi设置界面
    public final static String UNI_EVENT_REPLY_DEVICE_WIFI_SET = "device_wifi_set";//逆变器WiFi信息配置
    public final static String UNI_EVENT_REPLY_DEVICE_WIFI_GET = "device_wifi_get";//逆变器WiFi信息获取
    public final static String UNI_EVENT_REPLY_DEVICE_HOTSPOT_SET = "device_hotspot_set";//逆变器热点配置
    public final static String UNI_EVENT_REPLY_DEVICE_HOTSPOT_GET = "device_hotspot_get";//逆变器热点获取
    public final static String UNI_EVENT_REPLY_DEVICE_ETHERNET_SET = "device_ethernet_set";//逆变器以太网配置
    public final static String UNI_EVENT_REPLY_DEVICE_ETHERNET_GET = "device_ethernet_get";//逆变器以太网获取
 
    //endregion
 
    //region --------【原生】主动发送到【小程序】--------
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_MODEL = "uni_notification_model";//通知模块(大类)
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_DETAILS = "refresh_details";//刷新电站详情
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_USERINFO = "refresh_userinfo";//刷新用户信息
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_TEMPERATURE = "temperature_format_changed";//刷新单位温度
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_REFRESH_REFRESH_UNREAD_NUMBER = "refresh_unread_messages_number";//刷新未读消息数量
    public final static String UNI_EVENT_NOTIFICATION_MQTT_CONNECT_SUCCESS = "mqtt_connect_success";//通知mqtt连接成功
    public final static String UNI_EVENT_NOTIFICATION_REMOVE_VIEW = "remove_view";//通知uni移除界面
    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";//设备【包括下挂设备】oid列表Remove interface
    public final static String UNI_EVENT_NOTIFICATION_DEVICE_CONNECTION_STATUS = "connection_status";//逆变器连接路由器状态
    //endregion
 
    //region --------【原生】打开【小程序】--------
    /*********住宅模块*********/
    //页面路径带参数规则->(UNI_EVENT_OPEN_HOME_CREATION+?key=value&key=参数一)
    public final static String UNI_EVENT_OPEN_HOME_CREATION = "pages/powerStation/powerStationQuickConfig";//"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_DETAILS_C = "pages/powerStationDetail/tabbarPage";//C端打开【电站】详情
    public final static String UNI_EVENT_OPEN_HOME_Null_C = "pages/powerStationDetail/tabbarPage";//无电站时(不需要传参数)
    public final static String UNI_EVENT_OPEN_DEVICE_DETAILS = "pages/powerStationDetail/childPage/device/detail";//设备详情
    public final static String UNI_EVENT_OPEN_HOME_DEl = "del";//住宅【电站】删除
    /*********设备模块*********/
    //设备模块打开页面全路径
    //endregion
 
 
    /**
     * 小程序与原生通讯数据格式
     * 自定义数据格式
     */
    public static class UniCallBackBaseBean implements Serializable {
 
        private int code;//状态码
        private String msg;//信息描述
        private String type;//功能类型
        private Object data;//附加json数据
 
        public UniCallBackBaseBean(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }
 
        public UniCallBackBaseBean() {
            this.code = 0;
            this.msg = "成功";
        }
 
 
        public int getCode() {
            return code;
        }
 
        public void setCode(int code) {
            this.code = code;
        }
 
        public String getMsg() {
            return msg == null ? "" : msg;
        }
 
        public void setMsg(String msg) {
            this.msg = msg;
        }
 
        public Object getData() {
            return data;
        }
 
        public void setData(Object data) {
            this.data = data;
        }
 
 
        public String getType() {
            return type == null ? "" : type;
        }
 
        public void setType(String type) {
            this.type = type;
        }
 
 
    }
}