统一配置属性的名字风格

serial
BlueMatthew 1 year ago
parent 1492f05c39
commit 011cf05297

@ -134,11 +134,11 @@ public class MicroPhotoContext {
JSONObject jsonObject = TextUtils.isEmpty(content) ? new JSONObject() : new JSONObject(content); JSONObject jsonObject = TextUtils.isEmpty(content) ? new JSONObject() : new JSONObject(content);
appConfig.cmdid = jsonObject.optString("CMDID", ""); appConfig.cmdid = jsonObject.optString("CMDID", "");
appConfig.server = jsonObject.optString("Server", ""); appConfig.server = jsonObject.optString("server", "");
appConfig.port = jsonObject.optInt("Port", 0); appConfig.port = jsonObject.optInt("port", 0);
appConfig.protocol = jsonObject.optInt("Protocol", DEFAULT_PROTOCOL); appConfig.protocol = jsonObject.optInt("protocol", DEFAULT_PROTOCOL);
appConfig.networkProtocol = jsonObject.optInt("NetworkProtocol", 0); appConfig.networkProtocol = jsonObject.optInt("networkProtocol", 0);
appConfig.network = jsonObject.optInt("Network", 0); appConfig.network = jsonObject.optInt("network", 0);
appConfig.heartbeat = jsonObject.optInt("heartbeat", 0); appConfig.heartbeat = jsonObject.optInt("heartbeat", 0);
appConfig.packetSize = jsonObject.optInt("packetSize", 0); appConfig.packetSize = jsonObject.optInt("packetSize", 0);
@ -162,11 +162,11 @@ public class MicroPhotoContext {
JSONObject jsonObject = TextUtils.isEmpty(content) ? new JSONObject() : new JSONObject(content); JSONObject jsonObject = TextUtils.isEmpty(content) ? new JSONObject() : new JSONObject(content);
appConfig.cmdid = jsonObject.optString("CMDID", ""); appConfig.cmdid = jsonObject.optString("CMDID", "");
appConfig.server = jsonObject.optString("Server", ""); appConfig.server = jsonObject.optString(jsonObject.has("server") ? "server" : "Server", "");
appConfig.port = jsonObject.optInt("Port", 0); appConfig.port = jsonObject.optInt(jsonObject.has("port") ? "port" : "Port", 0);
appConfig.protocol = jsonObject.optInt("Protocol", DEFAULT_PROTOCOL); appConfig.protocol = jsonObject.optInt(jsonObject.has("protocol") ? "protocol" : "Protocol", DEFAULT_PROTOCOL);
appConfig.networkProtocol = jsonObject.optInt("NetworkProtocol", 0); appConfig.networkProtocol = jsonObject.optInt(jsonObject.has("networkProtocol") ? "networkProtocol" : "NetworkProtocol", 0);
appConfig.network = jsonObject.optInt("Network", 0); appConfig.network = jsonObject.optInt(jsonObject.has("network") ? "network" : "Network", 0);
appConfig.heartbeat = jsonObject.optInt("heartbeat", 0); appConfig.heartbeat = jsonObject.optInt("heartbeat", 0);
appConfig.packetSize = jsonObject.optInt("packetSize", 0); appConfig.packetSize = jsonObject.optInt("packetSize", 0);
@ -196,11 +196,11 @@ public class MicroPhotoContext {
JSONObject jsonObject = TextUtils.isEmpty(content) ? new JSONObject() : new JSONObject(content); JSONObject jsonObject = TextUtils.isEmpty(content) ? new JSONObject() : new JSONObject(content);
jsonObject.put("CMDID", appConfig.cmdid); jsonObject.put("CMDID", appConfig.cmdid);
jsonObject.put("Server", appConfig.server); jsonObject.put("server", appConfig.server);
jsonObject.put("Port", appConfig.port); jsonObject.put("port", appConfig.port);
jsonObject.put("Protocol", appConfig.protocol); jsonObject.put("protocol", appConfig.protocol);
jsonObject.put("NetworkProtocol", appConfig.networkProtocol); jsonObject.put("networkProtocol", appConfig.networkProtocol);
jsonObject.put("Network", appConfig.network); jsonObject.put("network", appConfig.network);
if (appConfig.heartbeat > 0) { if (appConfig.heartbeat > 0) {
jsonObject.put("heartbeat", appConfig.heartbeat); jsonObject.put("heartbeat", appConfig.heartbeat);

Loading…
Cancel
Save