From 636c4bb04e4fcd723766b82732990cdb4ae4ea2e Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 22 二月 2024 15:48:23 +0800
Subject: [PATCH] 删除掉本地库
---
app/src/main/java/com/hdl/photovoltaic/config/UserConfigManage.java | 137 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 125 insertions(+), 12 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 41dcd14..7667e27 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;
@@ -45,6 +48,9 @@
private String userId;
//褰撳墠鐨勪綇瀹匢D
private String homeId;
+
+
+ private String homeName;
//鏄惁鐧诲綍鐘舵��
private boolean isLogin;
//鏈湴閫氳绉橀挜
@@ -62,7 +68,7 @@
//鍒ゆ柇褰撳墠鏃堕棿鐐规槸鍚﹁兘澶熻嚜鍔ㄧ櫥褰�
public boolean isAutoLogin() {
//7澶╁唴鑷姩鐧诲綍
- return ((System.currentTimeMillis() - loginDateTime) < 7 * 24 * 60 * 60);
+ return ((System.currentTimeMillis() - loginDateTime) < (7 * 24 * 60 * 60 * 1000));
}
//鏄惁鍚屾剰闅愮鏀跨瓥
@@ -72,7 +78,94 @@
//杩滅▼杩炴帴鐨凪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;
+
+
+ /// <summary>
+ /// 娉ㄥ唽鏋佸厜ID
+ /// </summary>
+ public String registrationID;
+ /// <summary>
+ /// 娣诲姞鏋佸厜ID鍒颁簯绔垚鍔熸椂杩斿洖鐨�
+ /// </summary>
+ public String pushId;
+
+
+ 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 +215,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 +255,11 @@
this.theSameLoginAccount = theSameLoginAccount;
}
+ /**
+ * 鏄惁鏄疊绔处鍙风櫥褰�(true=B绔�)
+ *
+ * @return -
+ */
public boolean isBAccount() {
return isB_account;
}
@@ -202,34 +308,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