Merge branch 'master' of http://172.16.1.23:6688/r/~wjc/HDLPhotovoltaicDebugAPP
| | |
| | | * @Description : HDLError |
| | | */ |
| | | public class HDLLinkCode { |
| | | public static final HDLLinkCode HDL_UNKOWN_CODE=new HDLLinkCode(-1000,HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_UNKOWN_CODE)); |
| | | public static final HDLLinkCode HDL_DATA_ERROR =new HDLLinkCode(-2000, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_DATA_ERROR)) ; |
| | | public static final HDLLinkCode HDL_DATA_NULL_ERROR=new HDLLinkCode(-2001, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_DATA_NULL_ERROR)); |
| | | public static final HDLLinkCode HDL_AUTH_ERROR=new HDLLinkCode(2002,HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_AUTH_ERROR) ); |
| | | public static final HDLLinkCode HDL_SEND_ERROR=new HDLLinkCode(2003, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_SEND_ERROR)); |
| | | public static final HDLLinkCode HDL_TIMEOUT_ERROR=new HDLLinkCode(2004, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_TIMEOUT_ERROR)); |
| | | public static final HDLLinkCode HDL_UNAUTHORIZED_ERROR=new HDLLinkCode(-2005,HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_UNAUTHORIZED_ERROR)); |
| | | public static final HDLLinkCode HDL_AUTH_ERROR_GATEWAY_NOT_REGISTERED=new HDLLinkCode(-2006, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_AUTH_ERROR_GATEWAY_NOT_REGISTERED)); |
| | | public static final HDLLinkCode HDL_SEARCH_GATEWAY_TIMEOUT_ERROR=new HDLLinkCode(-2007, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_SEARCH_GATEWAY_TIMEOUT_ERROR)); |
| | | public static final HDLLinkCode HDL_AUTH_MAC_KEY_ERROR=new HDLLinkCode(-2008, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_AUTH_MAC_KEY_ERROR)); |
| | | public static final HDLLinkCode HDL_DATA_PARSING_ERROR=new HDLLinkCode(-2009, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_DATA_PARSING_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_DEVICE_LIST_ERROR=new HDLLinkCode(-2100, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_DEVICE_LIST_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_FUNCTION_LIST_ERROR=new HDLLinkCode(-2101, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_FUNCTION_LIST_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_FUNCTION_PROPERTIES_ERROR=new HDLLinkCode(-2102, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_FUNCTION_PROPERTIES_ERROR)); |
| | | public static final HDLLinkCode HDL_CONTROL_FAILURE_ERROR=new HDLLinkCode(-2103, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_CONTROL_FAILURE_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_GATEWAY_FAILURE_ERROR=new HDLLinkCode(-2104, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_GATEWAY_FAILURE_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_Zigbee_FAILURE_ERROR=new HDLLinkCode(-2105, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_Zigbee_FAILURE_ERROR)); |
| | | public static final HDLLinkCode HDL_GATEWAY_NOT_EXIST=new HDLLinkCode(-2106,HDLLinkLocalSdk.getInstance().getContext().getString( R.string.HDL_GATEWAY_NOT_EXIST)); |
| | | public static final HDLLinkCode HDL_GET_Zigbee_DEVICE_LIST_FAILURE_ERROR=new HDLLinkCode(-2107, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_Zigbee_DEVICE_LIST_FAILURE_ERROR)); |
| | | public static final HDLLinkCode HDL_MILLIMETER_NOT_EXIST=new HDLLinkCode(-2108, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_MILLIMETER_NOT_EXIST)); |
| | | public static final HDLLinkCode HDL_APPLICATION_CODE=new HDLLinkCode(-2109,HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_APPLICATION_EXCEPTION)); |
| | | public static final HDLLinkCode HDL_TOPIC_NOT_RIGHT=new HDLLinkCode(-2110,HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_TOPIC_NOT_RIGHT)); |
| | | public static final HDLLinkCode HDL_OBJECT_NOT_SUPPORT=new HDLLinkCode(-2111,HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_OBJECT_NOT_SUPPORT)); |
| | | public static final HDLLinkCode HDL_GATEWAY_REMOTE_NOT_RESPONSE=new HDLLinkCode(-2112,HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GATEWAY_REMOTE_NOT_RESPONSE)); |
| | | public static final HDLLinkCode HDL_SUCCESS=new HDLLinkCode(0,HDLLinkLocalSdk.getInstance().getContext().getString(R.string.SUCCESS)); |
| | | public static final HDLLinkCode HDL_UNKOWN_CODE = new HDLLinkCode(-1000, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_UNKOWN_CODE)); |
| | | public static final HDLLinkCode HDL_DATA_ERROR = new HDLLinkCode(-2000, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_DATA_ERROR)); |
| | | public static final HDLLinkCode HDL_DATA_NULL_ERROR = new HDLLinkCode(-2001, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_DATA_NULL_ERROR)); |
| | | public static final HDLLinkCode HDL_AUTH_ERROR = new HDLLinkCode(2002, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_AUTH_ERROR)); |
| | | public static final HDLLinkCode HDL_SEND_ERROR = new HDLLinkCode(2003, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_SEND_ERROR)); |
| | | public static final HDLLinkCode HDL_TIMEOUT_ERROR = new HDLLinkCode(2004, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_TIMEOUT_ERROR)); |
| | | public static final HDLLinkCode HDL_UNAUTHORIZED_ERROR = new HDLLinkCode(-2005, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_UNAUTHORIZED_ERROR)); |
| | | public static final HDLLinkCode HDL_AUTH_ERROR_GATEWAY_NOT_REGISTERED = new HDLLinkCode(-2006, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_AUTH_ERROR_GATEWAY_NOT_REGISTERED)); |
| | | public static final HDLLinkCode HDL_SEARCH_GATEWAY_TIMEOUT_ERROR = new HDLLinkCode(-2007, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_SEARCH_GATEWAY_TIMEOUT_ERROR)); |
| | | public static final HDLLinkCode HDL_AUTH_MAC_KEY_ERROR = new HDLLinkCode(-2008, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_AUTH_MAC_KEY_ERROR)); |
| | | public static final HDLLinkCode HDL_DATA_PARSING_ERROR = new HDLLinkCode(-2009, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_DATA_PARSING_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_DEVICE_LIST_ERROR = new HDLLinkCode(-2100, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_DEVICE_LIST_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_FUNCTION_LIST_ERROR = new HDLLinkCode(-2101, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_FUNCTION_LIST_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_FUNCTION_PROPERTIES_ERROR = new HDLLinkCode(-2102, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_FUNCTION_PROPERTIES_ERROR)); |
| | | public static final HDLLinkCode HDL_CONTROL_FAILURE_ERROR = new HDLLinkCode(-2103, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_CONTROL_FAILURE_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_GATEWAY_FAILURE_ERROR = new HDLLinkCode(-2104, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_GATEWAY_FAILURE_ERROR)); |
| | | public static final HDLLinkCode HDL_GET_Zigbee_FAILURE_ERROR = new HDLLinkCode(-2105, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_Zigbee_FAILURE_ERROR)); |
| | | public static final HDLLinkCode HDL_GATEWAY_NOT_EXIST = new HDLLinkCode(-2106, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GATEWAY_NOT_EXIST)); |
| | | public static final HDLLinkCode HDL_GET_Zigbee_DEVICE_LIST_FAILURE_ERROR = new HDLLinkCode(-2107, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GET_Zigbee_DEVICE_LIST_FAILURE_ERROR)); |
| | | public static final HDLLinkCode HDL_MILLIMETER_NOT_EXIST = new HDLLinkCode(-2108, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_MILLIMETER_NOT_EXIST)); |
| | | public static final HDLLinkCode HDL_APPLICATION_CODE = new HDLLinkCode(-2109, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_APPLICATION_EXCEPTION)); |
| | | public static final HDLLinkCode HDL_TOPIC_NOT_RIGHT = new HDLLinkCode(-2110, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_TOPIC_NOT_RIGHT)); |
| | | public static final HDLLinkCode HDL_OBJECT_NOT_SUPPORT = new HDLLinkCode(-2111, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_OBJECT_NOT_SUPPORT)); |
| | | public static final HDLLinkCode HDL_GATEWAY_REMOTE_NOT_RESPONSE = new HDLLinkCode(-2112, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GATEWAY_REMOTE_NOT_RESPONSE)); |
| | | public static final HDLLinkCode HDL_SUCCESS = new HDLLinkCode(0, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.SUCCESS)); |
| | | public static final HDLLinkCode HDL_GATEWAY_FOUND_LOCALLY = new HDLLinkCode(-2113, HDLLinkLocalSdk.getInstance().getContext().getString(R.string.HDL_GATEWAY_FOUND_LOCALLY)); |
| | | |
| | | private String msg; |
| | | private int code; |
| | |
| | | this.msg = msg; |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getMsg() { |
| | | return msg; |
| | | } |
| | |
| | | } |
| | | byte []data = linkResponse.getByteData(); |
| | | ModbusResponse modbusResponse= new ModbusResponse(); |
| | | modbusResponse.setTopic("Modbus"+data[0]+data[1]); |
| | | String topic="Modbus"+data[0]+data[1]; |
| | | modbusResponse.setTopic(topic); |
| | | modbusResponse.setData(data); |
| | | String oid = null; |
| | | //是否是通过主网关透传主题 |
| | |
| | | break; |
| | | } |
| | | } |
| | | EventDispatcher.getInstance().post(allTopic, modbusResponse); |
| | | EventDispatcher.getInstance().post(topic, modbusResponse); |
| | | //发布Zigbee原生主题及数据 |
| | | // EventDispatcher.getInstance().post(allTopic, zigbeeResponse); |
| | | // EventDispatcher.getInstance().post(allTopic, modbusResponse); |
| | | } |
| | | } catch (Exception e) { |
| | | LogUtils.e(TAG,"LinkResponse转ModbusResponse异常:"+ e.getMessage()); |
| | |
| | | String tempTopic = String.format(TopicConstant.NATIVE_MODBUS_DOWN, gatewayOidOrGatewayId); |
| | | LinkRequest request = new LinkRequest(tempTopic, payload, gatewayBean.getIsLocalEncrypt()); |
| | | |
| | | if ("true".equals(gatewayBean.getMaster())) { |
| | | // if ("true".equals(gatewayBean.getMaster())) { |
| | | request.setCloudTopic(String.format(TopicConstant.NATIVE_MODBUS_DOWN, HDLLinkConfig.getInstance().getGatewayId())); |
| | | } else { |
| | | request.setCloudTopic(String.format(TopicConstant.NATIVE_MODBUS_DOWN_SLAVE, HDLLinkConfig.getInstance().getGatewayId(), gatewayOidOrGatewayId)); |
| | | } |
| | | // } else { |
| | | // request.setCloudTopic(String.format(TopicConstant.NATIVE_MODBUS_DOWN_SLAVE, HDLLinkConfig.getInstance().getGatewayId(), gatewayOidOrGatewayId)); |
| | | // } |
| | | request.setReplyTopic("Modbus"+payload[0]+payload[1]); |
| | | long timeout = 2 * 1000; |
| | | |
| | |
| | | String topic, Object jObject, String sendPath, HDLLinkCallBack callBack) { |
| | | GatewayBean gatewayBean = this.getLocalGateway(mac); |
| | | if (gatewayBean == null) { |
| | | callBack.onError(HDLLinkException.getErrorWithCode(hdlLinkCode)); |
| | | callBack.onError(HDLLinkException.getErrorWithCode(HDLLinkCode.HDL_GATEWAY_FOUND_LOCALLY)); |
| | | return; |
| | | } |
| | | String topicSend = topic.replace("%s", gatewayBean.getOid()); |
| | |
| | | <string name="HDL_OBJECT_NOT_SUPPORT">对象不支持</string> |
| | | <string name="HDL_GATEWAY_REMOTE_NOT_RESPONSE">网关本地连接失败,通过远程通讯不回复</string> |
| | | <string name="SUCCESS">成功</string> |
| | | <string name="HDL_GATEWAY_FOUND_LOCALLY">本地找不到网关</string> |
| | | </resources> |
| | |
| | | <string name="HDL_OBJECT_NOT_SUPPORT">Object not supported</string> |
| | | <string name="HDL_GATEWAY_REMOTE_NOT_RESPONSE">Gateway local connection failed, unable to reply through remote communication</string> |
| | | <string name="SUCCESS">success</string> |
| | | <string name="HDL_GATEWAY_FOUND_LOCALLY">The gateway cannot be found locally</string> |
| | | </resources> |
| | |
| | | //必须配置uni |
| | | def mfph = [ |
| | | //宿主包名 |
| | | "apk.applicationId": "com.hdl.photovoltaic", |
| | | "apk.applicationId": "com.hdl.photovoltaic1", |
| | | ] |
| | | |
| | | android { |
| | | compileSdk 32 |
| | | |
| | | defaultConfig { |
| | | applicationId "com.hdl.photovoltaic" |
| | | applicationId "com.hdl.photovoltaic1" |
| | | minSdk 23 |
| | | targetSdk 32 |
| | | versionCode 1 |
| | |
| | | return isOnlineServer; |
| | | } |
| | | |
| | | /// 用户注册所在服务器域名地址 |
| | | /// 用户注册所在服务器域名地址(用户请求网络用的) |
| | | private static String sUserRegionUrl; |
| | | |
| | | public static String getUserRegionUrl() { |
| | |
| | | package com.hdl.photovoltaic.internet; |
| | | |
| | | |
| | | import com.hdl.photovoltaic.other.HdlAccountLogic; |
| | | import com.hdl.sdk.link.core.callback.HDLLinkCallBack; |
| | | import com.hdl.sdk.link.gateway.HDLLinkLocalGateway; |
| | | |
| | |
| | | */ |
| | | public class TcpClient { |
| | | |
| | | private static volatile TcpClient sTcpClient; |
| | | |
| | | /** |
| | | * 获取当前对象 |
| | | * |
| | | * @return HdlAccountLogic |
| | | */ |
| | | public static synchronized TcpClient getInstance() { |
| | | if (sTcpClient == null) { |
| | | synchronized (TcpClient.class) { |
| | | if (sTcpClient == null) { |
| | | sTcpClient = new TcpClient(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return sTcpClient; |
| | | } |
| | | |
| | | /** |
| | | * 发送数据到Link网关 |
| | | * |
| | |
| | | * 写远程信息的,例如服务器地址、HomeId、密钥之类 |
| | | * 与服务器相关的 |
| | | * */ |
| | | public static final String GATEWAY_EDIT_REMOTE = "/user/%s/custom/gateway/remote/edit"; |
| | | public static final String GATEWAY_SEND_REMOTE_EDIT = "/user/%s/custom/gateway/remote/edit"; |
| | | |
| | | /* |
| | | * 网关恢复出场设置命令 |
| | |
| | | import com.google.gson.reflect.TypeToken; |
| | | import com.hdl.hdlhttp.HxHttp; |
| | | import com.hdl.photovoltaic.bean.HttpResponsePack; |
| | | import com.hdl.photovoltaic.config.AppConfigManage; |
| | | import com.hdl.photovoltaic.config.UserConfigManage; |
| | | import com.hdl.photovoltaic.internet.HttpClient; |
| | | import com.hdl.photovoltaic.internet.TcpClient; |
| | | import com.hdl.photovoltaic.internet.api.HttpApi; |
| | | import com.hdl.photovoltaic.internet.api.TopicApi; |
| | | import com.hdl.photovoltaic.listener.BaseSuccessFailureCallBeak; |
| | | import com.hdl.photovoltaic.listener.CloudCallBeak; |
| | | import com.hdl.photovoltaic.ui.bean.CloudInverterChildDeviceBean; |
| | |
| | | import com.hdl.sdk.link.common.exception.HDLLinkException; |
| | | import com.hdl.sdk.link.core.bean.gateway.GatewayBean; |
| | | import com.hdl.sdk.link.core.callback.GatewayCallBack; |
| | | import com.hdl.sdk.link.core.callback.HDLLinkCallBack; |
| | | import com.hdl.sdk.link.gateway.HDLLinkLocalGateway; |
| | | |
| | | import java.lang.reflect.Type; |
| | |
| | | * 全量更新OID |
| | | * |
| | | * @param oidList oid列表 |
| | | * @param cloudCallBeak 回调 |
| | | * @param cloudCallBeak 回调update |
| | | */ |
| | | public void fullRenewalOid(List<OidBean> oidList, CloudCallBeak<Boolean> cloudCallBeak) { |
| | | public void fullUpdateOid(List<OidBean> oidList, CloudCallBeak<Boolean> cloudCallBeak) { |
| | | String requestUrl = HttpApi.POST_Device_ChildDevices_List; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("operationSource", "PROGRAM_ENERGY");// |
| | |
| | | |
| | | |
| | | /** |
| | | * 设置网关远程参数 |
| | | * |
| | | * @param mac 设备mac |
| | | * @param cloudCallBeak 回调update |
| | | */ |
| | | public void steGatewayParam(String mac, CloudCallBeak<Boolean> cloudCallBeak) { |
| | | String requestUrl = TopicApi.GATEWAY_SEND_REMOTE_EDIT; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("homeId", UserConfigManage.getInstance().getHomeId()); |
| | | json.addProperty("server_addr", AppConfigManage.getUserRegionUrl()); |
| | | json.addProperty("local_secret", UserConfigManage.getInstance().getLocalSecret()); |
| | | TcpClient.getInstance().sendDataToLinkGateway(mac, true, requestUrl, json, "", new HDLLinkCallBack() { |
| | | @Override |
| | | public void onSuccess(String msg) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onError(HDLLinkException e) { |
| | | |
| | | } |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * 编辑网关参数 |
| | | * |
| | | * @param mac 设备mac |
| | | * @param cloudCallBeak 回调update |
| | | */ |
| | | public void steEditGatewayParam(String mac, CloudCallBeak<Boolean> cloudCallBeak) { |
| | | String requestUrl = TopicApi.GATEWAY_SEND_EDIT; |
| | | JsonObject json = new JsonObject(); |
| | | json.addProperty("master", "true"); |
| | | TcpClient.getInstance().sendDataToLinkGateway(mac, true, requestUrl, json, "", new HDLLinkCallBack() { |
| | | @Override |
| | | public void onSuccess(String msg) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void onError(HDLLinkException e) { |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 搜索网关列表 |
| | | * |
| | | * @param gatewayCallBack - |
| | |
| | | |
| | | } |
| | | if (callback != null) { |
| | | uniCallbackData(null, "0", "", callback); |
| | | uniCallbackData(null, callback); |
| | | } |
| | | } else if (HDLUniMP.UNI_EVENT_REPLY_DEVICE_MODEL.equals(event)) { |
| | | //设备模块 |
| | | switch (type) { |
| | | case HDLUniMP.UNI_EVENT_REPLY_DEVICE_ADD: { |
| | | //添加 |
| | | |
| | | } |
| | | break; |
| | | case HDLUniMP.UNI_EVENT_REPLY_DEVICE_LIST: { |
| | |
| | | @Override |
| | | public void onError(HDLLinkException e) { |
| | | //发送失败 |
| | | uniCallbackData(null, e.getCode() + "", "", callback); |
| | | uniCallbackData(null, e.getCode(), "", callback); |
| | | } |
| | | }); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public void onError(HDLLinkException e) { |
| | | uniCallbackData(null, e.getCode() + "", "失败", callback); |
| | | uniCallbackData(null, e.getCode(), e.getMsg(), callback); |
| | | } |
| | | }); |
| | | } |
| | |
| | | * @param msg 结果描述的信息 |
| | | * @param callback 回调 |
| | | */ |
| | | private void uniCallbackData(Object obj, String code, String msg, DCUniMPJSCallback callback) { |
| | | private void uniCallbackData(Object obj, int code, String msg, DCUniMPJSCallback callback) { |
| | | HDLUniMP.UniCallBackBaseBean uniCallBackBaseBean = new HDLUniMP.UniCallBackBaseBean(); |
| | | try { |
| | | uniCallBackBaseBean.setCode(code); |
| | |
| | | } |
| | | |
| | | private void uniCallbackData(Object obj, DCUniMPJSCallback callback) { |
| | | uniCallbackData(obj, HDLLinkCode.HDL_SUCCESS + "", HDLLinkCode.HDL_SUCCESS.getMsg(), callback); |
| | | uniCallbackData(obj, HDLLinkCode.HDL_SUCCESS.getCode(), HDLLinkCode.HDL_SUCCESS.getMsg(), callback); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public static class UniCallBackBaseBean implements Serializable { |
| | | |
| | | private String code;//状态码 |
| | | private int code;//状态码 |
| | | private String mes;//信息描述 |
| | | private String type;//功能类型 |
| | | private Object data;//附加json数据 |
| | | |
| | | public UniCallBackBaseBean(String code, String mes) { |
| | | public UniCallBackBaseBean(int code, String mes) { |
| | | this.code = code; |
| | | this.mes = mes; |
| | | } |
| | | |
| | | public UniCallBackBaseBean() { |
| | | this.code = "0"; |
| | | this.code = 0; |
| | | this.mes = "成功"; |
| | | } |
| | | |
| | | |
| | | public String getCode() { |
| | | return code == null ? "" : code; |
| | | public int getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | public void setCode(int code) { |
| | | this.code = code; |
| | | } |
| | | |
| | |
| | | # Location of the SDK. This is only used by Gradle. |
| | | # For customization when using a Version Control System, please read the |
| | | # header note. |
| | | #Thu Jun 29 10:54:59 CST 2023 |
| | | sdk.dir=/Users/wenjucheng/Library/Android/sdk |
| | | #Thu Jun 29 15:41:36 CST 2023 |
| | | sdk.dir=/Users/hdl/Library/Developer/Xamarin/android-sdk-macosx |