mac
2023-11-23 5e080d063f213f2b2c2ed34e1d54b9fd7df1c6b0
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
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_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_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协议
 
    /*********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_FIRMWARES_CANCEL_UPGRADE = "firmwares_cancel_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_DRIVER_CANCEL_UPGRADE = "driver_cancel_upgrade";//设备驱动取消升级
    public final static String UNI_EVENT_REPLY_OTA_DRIVER_CANCEL_DOWNLOAD = "cancel_download";//设备取消下载升级文件
 
 
    /*********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
 
    //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";//设备【包括下挂设备】oid列表
    //endregion
 
    //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 int code;//状态码
        private String mes;//信息描述
        private String type;//功能类型
        private Object data;//附加json数据
 
        public UniCallBackBaseBean(int code, String mes) {
            this.code = code;
            this.mes = mes;
        }
 
        public UniCallBackBaseBean() {
            this.code = 0;
            this.mes = "成功";
        }
 
 
        public int getCode() {
            return code;
        }
 
        public void setCode(int code) {
            this.code = code;
        }
 
        public String getMes() {
            return mes == null ? "" : mes;
        }
 
        public void setMes(String mes) {
            this.mes = mes;
        }
 
        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;
        }
 
 
    }
}