wuxw7
2018-05-09 1254c7d457b742e16ffc8c7820a445e1985fa55c
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;
/**
 * 提供服务
@@ -12,13 +13,14 @@
    private String serviceCode;
    private String invokeMethod;
    private String businessTypeCd;
    private String name;
    private int seq;
    //消息队里名称 只有异步时有用
    private String messageQueueName;
    private String url;
@@ -49,13 +51,6 @@
        this.serviceCode = serviceCode;
    }
    public String getInvokeMethod() {
        return invokeMethod;
    }
    public void setInvokeMethod(String invokeMethod) {
        this.invokeMethod = invokeMethod;
    }
    public String getBusinessTypeCd() {
        return businessTypeCd;
@@ -128,4 +123,34 @@
    public void setStatusCd(String statusCd) {
        this.statusCd = statusCd;
    }
    public String getMessageQueueName() {
        return messageQueueName;
    }
    public void setMessageQueueName(String messageQueueName) {
        this.messageQueueName = messageQueueName;
    }
    public AppService builder(Map serviceInfo){
        this.setBusinessTypeCd(serviceInfo.get("business_type_cd").toString());
        this.setInvokeModel(serviceInfo.get("invoke_model").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(Integer.parseInt(serviceInfo.get("service_id").toString()));
        this.setStatusCd("0");
        return this;
    }
    public static AppService newInstance(){
        return new AppService();
    }
}