From b3b17b231e2f2840332ce6eb96f791865fdec6d5 Mon Sep 17 00:00:00 2001
From: zhubaomin <zhubaomin>
Date: 星期一, 14 四月 2025 16:38:16 +0800
Subject: [PATCH] 代码优化
---
pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwConfigVo.java | 114 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 114 insertions(+), 0 deletions(-)
diff --git a/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwConfigVo.java b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwConfigVo.java
new file mode 100644
index 0000000..20a90e6
--- /dev/null
+++ b/pipIrr-platform/pipIrr-mw/pipIrr-mwTest-server/src/main/java/com/dy/testServer/forRmi/MwConfigVo.java
@@ -0,0 +1,114 @@
+package com.dy.testServer.forRmi;
+
+import com.alibaba.fastjson2.JSON;
+
+public class MwConfigVo {
+ //妯℃嫙瀹㈡埛鐨凴tuAddr璧峰鍙�
+ public Long rtuAddrStart = 0L ;
+ //妯℃嫙瀹㈡埛鐨凴tuAddr鎴鍙�
+ public Long rtuAddrEnd = 0L ;
+ //閫氫俊涓棿浠禝P
+ public String tcpServerIp = "" ;
+ //閫氫俊涓棿浠剁鍙�
+ public Integer tcpServerPort = 0 ;
+ //鍙戦�佹暟鎹暟鎹棿闅�
+ public Integer sendInterval = 2 ;//绉�
+ //姣忎竴杞鍙戦�佹暟鎹紝鍏朵腑鍖呮嫭蹇冭烦鍙戦�佹鏁�
+ public Integer heartbeatTimes = 3 ;
+ //鍙戦�佹暟鎹鏁�
+ public Integer sendTimes = 0 ;
+ //鍙戦�佸畬鏁版嵁鍚庯紝鏄惁鍏抽棴TCP杩炴帴锛�1鏄紝0鍚�
+ public Integer sendOverThenCloseConnect = 0 ;
+
+ /**
+ * 瀵硅薄杞垚json
+ * @return 杩斿洖 json
+ * @throws Exception 寮傚父
+ */
+ public String toJson()throws Exception{
+ try{
+ return JSON.toJSONString(this) ;
+ //return new JSONSerializer().exclude(new String[]{"class", "*.class"}).deepSerialize(this);
+ }catch(Exception e){
+ throw new Exception(e.getMessage() , e ) ;
+ }
+ }
+ /**
+ * json杞垚瀵硅薄
+ * @param json 鍙傛暟
+ * @return 杩斿洖瀵硅薄
+ * @throws Exception 寮傚父
+ */
+ public static MwConfigVo jsonToObject(String json)throws Exception{
+ try{
+ return JSON.parseObject(json, MwConfigVo.class) ;
+ //return new JSONDeserializer<ResConfigVo>().deserialize(json, ResConfigVo.class) ;
+ }catch(Exception e){
+ throw new Exception(e.getMessage() , e ) ;
+ }
+ }
+
+ public Long getRtuAddrStart() {
+ return rtuAddrStart;
+ }
+
+ public void setRtuAddrStart(Long rtuAddrStart) {
+ this.rtuAddrStart = rtuAddrStart;
+ }
+
+ public Long getRtuAddrEnd() {
+ return rtuAddrEnd;
+ }
+
+ public void setRtuAddrEnd(Long rtuAddrEnd) {
+ this.rtuAddrEnd = rtuAddrEnd;
+ }
+
+ public String getTcpServerIp() {
+ return tcpServerIp;
+ }
+
+ public void setTcpServerIp(String tcpServerIp) {
+ this.tcpServerIp = tcpServerIp;
+ }
+
+ public Integer getTcpServerPort() {
+ return tcpServerPort;
+ }
+
+ public void setTcpServerPort(Integer tcpServerPort) {
+ this.tcpServerPort = tcpServerPort;
+ }
+
+ public Integer getSendInterval() {
+ return sendInterval;
+ }
+
+ public void setSendInterval(Integer sendInterval) {
+ this.sendInterval = sendInterval;
+ }
+
+ public Integer getHeartbeatTimes() {
+ return heartbeatTimes;
+ }
+
+ public void setHeartbeatTimes(Integer heartbeatTimes) {
+ this.heartbeatTimes = heartbeatTimes;
+ }
+
+ public Integer getSendTimes() {
+ return sendTimes;
+ }
+
+ public void setSendTimes(Integer sendTimes) {
+ this.sendTimes = sendTimes;
+ }
+
+ public Integer getSendOverThenCloseConnect() {
+ return sendOverThenCloseConnect;
+ }
+
+ public void setSendOverThenCloseConnect(Integer sendOverThenCloseConnect) {
+ this.sendOverThenCloseConnect = sendOverThenCloseConnect;
+ }
+}
--
Gitblit v1.8.0