From cddcf22a61489ee9c2dfee169d817ccd66f95430 Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期五, 03 九月 2021 02:23:43 +0800
Subject: [PATCH] 优化代码

---
 java110-bean/src/main/java/com/java110/entity/center/AppService.java |   55 +++++++++++++++++++++++++++++++++++--------------------
 1 files changed, 35 insertions(+), 20 deletions(-)

diff --git a/java110-bean/src/main/java/com/java110/entity/center/AppService.java b/java110-bean/src/main/java/com/java110/entity/center/AppService.java
old mode 100644
new mode 100755
index d7f1382..271f67c
--- a/java110-bean/src/main/java/com/java110/entity/center/AppService.java
+++ b/java110-bean/src/main/java/com/java110/entity/center/AppService.java
@@ -1,6 +1,7 @@
 package com.java110.entity.center;
 
 import java.io.Serializable;
+import java.util.Map;
 
 /**
  * 鎻愪緵鏈嶅姟
@@ -8,11 +9,9 @@
  */
 public class AppService implements Serializable{
 
-    private int serviceId;
+    private String serviceId;
 
     private String serviceCode;
-
-    private String invokeMethod;
 
     private String businessTypeCd;
 
@@ -28,7 +27,9 @@
     //鍙湁webservice鏃舵墠鏈夌敤
     private String method;
 
-    private String invokeModel;
+    private String isInstance;
+
+
 
     private int timeOut;
 
@@ -36,11 +37,11 @@
 
     private String statusCd;
 
-    public int getServiceId() {
+    public String getServiceId() {
         return serviceId;
     }
 
-    public void setServiceId(int serviceId) {
+    public void setServiceId(String serviceId) {
         this.serviceId = serviceId;
     }
 
@@ -52,13 +53,6 @@
         this.serviceCode = serviceCode;
     }
 
-    public String getInvokeMethod() {
-        return invokeMethod;
-    }
-
-    public void setInvokeMethod(String invokeMethod) {
-        this.invokeMethod = invokeMethod;
-    }
 
     public String getBusinessTypeCd() {
         return businessTypeCd;
@@ -100,13 +94,6 @@
         this.method = method;
     }
 
-    public String getInvokeModel() {
-        return invokeModel;
-    }
-
-    public void setInvokeModel(String invokeModel) {
-        this.invokeModel = invokeModel;
-    }
 
     public int getTimeOut() {
         return timeOut;
@@ -140,5 +127,33 @@
         this.messageQueueName = messageQueueName;
     }
 
+    public String getIsInstance() {
+        return isInstance;
+    }
+
+    public void setIsInstance(String isInstance) {
+        this.isInstance = isInstance;
+    }
+
+    public AppService builder(Map serviceInfo){
+        this.setBusinessTypeCd(serviceInfo.get("business_type_cd").toString());
+        this.setMessageQueueName(serviceInfo.get("messageQueueName") == null ? null :serviceInfo.get("messageQueueName").toString());
+        this.setMethod(serviceInfo.get("method")==null ? null:serviceInfo.get("method").toString());
+        this.setName(serviceInfo.get("name").toString());
+        this.setRetryCount(Integer.parseInt(serviceInfo.get("retry_count").toString()));
+        this.setSeq(Integer.parseInt(serviceInfo.get("seq").toString()));
+        this.setServiceCode(serviceInfo.get("service_code").toString());
+        this.setTimeOut(Integer.parseInt(serviceInfo.get("timeout").toString()));
+        this.setUrl(serviceInfo.get("url") == null ? null : serviceInfo.get("url").toString());
+        this.setServiceId(serviceInfo.get("service_id").toString());
+        this.setIsInstance(serviceInfo.get("is_instance").toString());
+        this.setStatusCd("0");
+        return this;
+    }
+
+    public static AppService newInstance(){
+        return new AppService();
+    }
+
 
 }

--
Gitblit v1.8.0