From 1f3acf4c29f367e40a3f589b51176ed24e28948f Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期二, 02 九月 2025 17:54:42 +0800
Subject: [PATCH] 2025年09月02日17:54:39
---
app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java | 232 ++++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 219 insertions(+), 13 deletions(-)
diff --git a/app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java b/app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java
index cc842ec..8ddb2c1 100644
--- a/app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java
+++ b/app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java
@@ -4,10 +4,13 @@
import android.text.TextUtils;
import com.google.gson.Gson;
+import com.hdl.photovoltaic.HDLApp;
import com.hdl.photovoltaic.other.HdlFileLogic;
import com.hdl.photovoltaic.other.HdlLogLogic;
import com.hdl.photovoltaic.other.HdlResidenceLogic;
import com.hdl.photovoltaic.ui.bean.HouseInfoBean;
+import com.hdl.photovoltaic.utils.LocalManageUtil;
+import com.hdl.photovoltaic.utils.SharedPreUtils;
import java.util.ArrayList;
import java.util.List;
@@ -33,6 +36,9 @@
return sUserConfigManage;
}
+
+ //uni涓�绾х晫闈㈢殑瀹夊叏璺濈鑳屾櫙棰滆壊锛�0=鐢电珯璇︽儏鐣岄潰锛�1=娣诲姞鐢电珯鐣岄潰锛�2=璁惧璋冩祴鐣岄潰锛�
+ private int uniBottomSafeDistanceBackgroundColor = 1;
//褰撳墠璐﹀彿锛氬埛鏂癟oken鐢ㄧ殑token(涓嶇敤璁板綍浠�涔堟湁鏁堟湡,濡傛灉鍒锋柊澶辫触,灏辫涪浜哄嵆鍙�)
private String refreshToken;
//璐︽埛鐧诲綍鎴愬姛鏃剁殑鏃堕棿
@@ -45,14 +51,26 @@
private String userId;
//褰撳墠鐨勪綇瀹匢D
private String homeId;
+
+
+ private String homeName;
//鏄惁鐧诲綍鐘舵��
private boolean isLogin;
//鏈湴閫氳绉橀挜
private String localSecret;
- //鏄惁鏄疊绔处鍙风櫥褰�
+ //鏄惁鏄疊绔处鍙风櫥褰�(true=B绔�)
private boolean isB_account;
+ //鏄惁姝e紡鏈嶅姟鍣�(true锛氭寮忥紝false锛氭祴璇�)
+ private boolean isOnlineServer = false;
+ public boolean isOnlineServer() {
+ return isOnlineServer;
+ }
+
+ public void setOnlineServer(boolean onlineServer) {
+ isOnlineServer = onlineServer;
+ }
//鏄惁鏄敤鎴蜂綋楠岃处鍙风櫥褰�
private boolean isUserExperience;
@@ -62,7 +80,7 @@
//鍒ゆ柇褰撳墠鏃堕棿鐐规槸鍚﹁兘澶熻嚜鍔ㄧ櫥褰�
public boolean isAutoLogin() {
//7澶╁唴鑷姩鐧诲綍
- return ((System.currentTimeMillis() - loginDateTime) < 7 * 24 * 60 * 60);
+ return ((System.currentTimeMillis() - loginDateTime) < (7 * 24 * 60 * 60 * 1000));
}
//鏄惁鍚屾剰闅愮鏀跨瓥
@@ -72,7 +90,157 @@
//杩滅▼杩炴帴鐨凪qtt鐨勫鎴风ID
public String connEmqClientId;
//褰撳墠鐧诲綍鐨勮处鍙锋槸涓嶆槸涔嬪墠鐨勮处鍙�
- public boolean theSameLoginAccount;
+ private boolean theSameLoginAccount;
+
+ //缁戝畾鎵嬫満鍙�
+ private String bingPhone;
+ //缁戝畾閭
+ private String bingEmail;
+
+ //娓╁害鍗曚綅(C鎽勬皬搴�;F=鍗庢皬搴�)
+ private String temperature_unit = "鈩�";
+
+ //app褰撳墠鐨勮瑷�
+ private String currentAppLanguage;
+
+
+ //鐢ㄦ埛澶村儚
+ private String userImageUrl = "/static/image/user-default-head.png";
+
+
+ /// <summary>
+ /// 娉ㄥ唽鏋佸厜ID
+ /// </summary>
+ private String registrationID;
+ /// <summary>
+ /// 娣诲姞鏋佸厜ID鍒颁簯绔垚鍔熸椂杩斿洖鐨�
+ /// </summary>
+ private String pushId;
+
+ /**
+ * 鏃犵綉妯″紡鏍囪瘑(true=鏃犵綉妯″紡,false=姝e父妯″紡)
+ */
+ private boolean noNetworkFlag = false;
+
+ public boolean isAutomaticSkipNoNetworkFlag() {
+ return automaticSkipNoNetworkFlag;
+ }
+
+ public void setAutomaticSkipNoNetworkFlag(boolean automaticSkipNoNetworkFlag) {
+ this.automaticSkipNoNetworkFlag = automaticSkipNoNetworkFlag;
+ }
+
+ /**
+ * 鑷姩璺宠浆鍒版棤缃戞ā寮�(true=鍚屾剰璺宠浆,false=涓嶅悓鎰忚烦杞�)
+ */
+ private boolean automaticSkipNoNetworkFlag = false;
+
+ /**
+ * 鏃犵綉妯″紡璁惧mac
+ */
+ private String noNetworkDeviceMac;
+ /**
+ * 鏃犵綉妯″紡璁惧鐧诲綍M瀵嗙爜
+ */
+ private String noNetworkPassword;
+
+ public boolean isNoNetworkFlag() {
+ return noNetworkFlag;
+ }
+
+ public void setNoNetworkFlag(boolean noNetworkFlag) {
+ this.noNetworkFlag = noNetworkFlag;
+ }
+
+ public String getNoNetworkDeviceMac() {
+ return noNetworkDeviceMac == null ? "" : noNetworkDeviceMac;
+ }
+
+ public void setNoNetworkDeviceMac(String noNetworkDeviceMac) {
+ this.noNetworkDeviceMac = noNetworkDeviceMac;
+ }
+
+ public String getNoNetworkPassword() {
+ return noNetworkPassword == null ? "" : noNetworkPassword;
+ }
+
+ public void setNoNetworkPassword(String noNetworkPassword) {
+ this.noNetworkPassword = noNetworkPassword;
+ }
+
+
+ public String getUserImageUrl() {
+ return userImageUrl == null ? "/static/image/user-default-head.png" : userImageUrl;
+ }
+
+ public void setUserImageUrl(String userImageUrl) {
+ this.userImageUrl = userImageUrl;
+ }
+
+ public String getRegistrationID() {
+ return registrationID == null ? "" : registrationID;
+ }
+
+ public void setRegistrationID(String registrationID) {
+ this.registrationID = registrationID;
+ }
+
+ public String getPushId() {
+ return pushId == null ? "" : pushId;
+ }
+
+ public void setPushId(String pushId) {
+ this.pushId = pushId;
+ }
+
+ public String getCurrentAppLanguage() {
+ return currentAppLanguage;
+ }
+
+ public void setCurrentAppLanguage(String currentAppLanguage) {
+ this.currentAppLanguage = currentAppLanguage;
+ }
+
+ public String getTemperature_unit() {
+ return temperature_unit;
+ }
+
+ public void setTemperature_unit(String temperature_unit) {
+ this.temperature_unit = temperature_unit;
+ }
+
+ public String getBingPhone() {
+ return bingPhone == null ? "" : bingPhone;
+ }
+
+ public void setBingPhone(String bingPhone) {
+ this.bingPhone = bingPhone;
+ }
+
+
+ public String getBingEmail() {
+ return bingEmail == null ? "" : bingEmail;
+ }
+
+ public void setBingEmail(String bingEmail) {
+ this.bingEmail = bingEmail;
+ }
+
+ /**
+ * 鐢ㄦ埛鍚嶇О
+ *
+ * @return -
+ */
+ public String getUserName() {
+
+ return TextUtils.isEmpty(userName) ? account : userName;
+ }
+
+ public void setUserName(String userName) {
+ this.userName = userName;
+ }
+
+ private String userName;//鐢ㄦ埛鍚嶇О
public String getRefreshToken() {
return refreshToken == null ? "" : refreshToken;
@@ -122,6 +290,14 @@
this.homeId = homeId;
}
+ public String getHomeName() {
+ return homeName == null ? "" : homeName;
+ }
+
+ public void setHomeName(String homeName) {
+ this.homeName = homeName;
+ }
+
public boolean isAcceiptPolicy() {
return acceiptPolicy;
}
@@ -154,6 +330,11 @@
this.theSameLoginAccount = theSameLoginAccount;
}
+ /**
+ * 鏄惁鏄疊绔处鍙风櫥褰�(true=B绔�)
+ *
+ * @return -
+ */
public boolean isBAccount() {
return isB_account;
}
@@ -176,6 +357,24 @@
public void setLocalSecret(String localSecret) {
this.localSecret = localSecret;
+ }
+
+ /**
+ * uni涓�绾х晫闈㈢殑瀹夊叏璺濈鑳屾櫙棰滆壊锛�0=鐢电珯璇︽儏鐣岄潰锛�1=娣诲姞鐢电珯鐣岄潰锛�2=璁惧璋冩祴鐣岄潰锛�
+ *
+ * @return 鍊�
+ */
+ public int getUniBottomSafeDistanceBackgroundColor() {
+ return this.uniBottomSafeDistanceBackgroundColor;
+ }
+
+ /**
+ * uni涓�绾х晫闈㈢殑瀹夊叏璺濈鑳屾櫙棰滆壊锛�0=鐢电珯璇︽儏鐣岄潰锛�1=娣诲姞鐢电珯鐣岄潰锛�2=璁惧璋冩祴鐣岄潰锛�
+ *
+ * @param uniBottomSafeDistanceBackgroundColorValue 锛�0=鐢电珯璇︽儏鐣岄潰锛�1=娣诲姞鐢电珯鐣岄潰锛�2=璁惧璋冩祴鐣岄潰锛�
+ */
+ public void setUniBottomSafeDistanceBackgroundColor(int uniBottomSafeDistanceBackgroundColorValue) {
+ this.uniBottomSafeDistanceBackgroundColor = uniBottomSafeDistanceBackgroundColorValue;
}
/**
@@ -202,34 +401,41 @@
* 鍒锋柊
*/
private void reFresh() {
- String str = HdlFileLogic.getInstance().readFile(FILENAME);
+ String str = HdlFileLogic.getInstance().readFile(HdlFileLogic.getInstance().getUserFilePath());
+// String str =SharedPreUtils.getSharedPreferencesKey("UserConfigManage.json",HDLApp.getInstance());
if (!TextUtils.isEmpty(str) && str.length() > 0) {
//璇诲彇淇濆瓨鐨勬暟鎹�
Gson gson = new Gson();
sUserConfigManage = gson.fromJson(str, UserConfigManage.class);
+ if (sUserConfigManage == null) {
+ sUserConfigManage = new UserConfigManage();
+ }
}
}
+
/**
* 淇濆瓨
*/
public void Save() {
if (sUserConfigManage == null) {
- HdlLogLogic.print("UserConfigManage", "淇濆瓨鐢ㄦ埛淇℃伅鏂囦欢澶辫触");
+ HdlLogLogic.print("UserConfigManage淇濆瓨鐢ㄦ埛淇℃伅鏂囦欢澶辫触", false);
return;
}
Gson gson = new Gson();
String json = gson.toJson(sUserConfigManage);
- HdlFileLogic.getInstance().writeFile(FILENAME, json);
+ HdlFileLogic.getInstance().writeFile(HdlFileLogic.getInstance().getUserFilePath(), json);
+// SharedPreUtils.saveMyDataInfo("UserConfigManage.json", json, HDLApp.getInstance());
}
- /// <summary>
- /// Config鏂囦欢鍚�
- /// </summary>
- private static final String FILENAME = "UserConfigManage.json";
-
-
-
+ /**
+ * true琛ㄧず鏄腑鏂�
+ *
+ * @return true琛ㄧず鏄腑鏂�
+ */
+ public boolean isZh() {
+ return currentAppLanguage.equals(LocalManageUtil.zh);
+ }
}
--
Gitblit v1.8.0