Merge branch 'dev' of http://git.estsh.com/i3-IMPP/i3plus-pojo into dev
commit
5e6a2d8839
@ -0,0 +1,57 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<artifactId>i3plus-pojo</artifactId>
|
||||||
|
<groupId>i3plus.pojo</groupId>
|
||||||
|
<version>1.0-DEV-SNAPSHOT</version>
|
||||||
|
<relativePath>../../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>i3plus-pojo-bsp</artifactId>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>i3plus.pojo</groupId>
|
||||||
|
<artifactId>i3plus-pojo-base</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>dev</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>DEV</profileActive>
|
||||||
|
</properties>
|
||||||
|
<activation>
|
||||||
|
<activeByDefault>true</activeByDefault>
|
||||||
|
</activation>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>test</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>TEST</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>docker</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>DOCKER</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
<profile>
|
||||||
|
<id>prod</id>
|
||||||
|
<properties>
|
||||||
|
<profileActive>PROD</profileActive>
|
||||||
|
</properties>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}-${project.version}</finalName>
|
||||||
|
</build>
|
||||||
|
</project>
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.client.bean.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ns
|
||||||
|
* @create 2021/5/24 0024 上午 11:08
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@ToString
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Api("方法信息")
|
||||||
|
public class MethodDescription implements Serializable {
|
||||||
|
@ApiParam("方法的代理对象")
|
||||||
|
private final Method method;
|
||||||
|
@ApiParam("方法参数的长度")
|
||||||
|
private final int ParamLength;
|
||||||
|
@ApiParam("方法参数的详细信息")
|
||||||
|
private final List<ParamInfo> paramInfoList;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.client.bean.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ns
|
||||||
|
* @create 2021/5/26 0026 下午 13:24
|
||||||
|
* 方法执行所需要的参数
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Api("方法执行所需要的参数")
|
||||||
|
public class MethodExcuteParam implements Serializable {
|
||||||
|
@ApiParam("调用方法的key")
|
||||||
|
private String methodHandlerKey;
|
||||||
|
@ApiParam(value = "调用方法的参数map", allowEmptyValue = true)
|
||||||
|
private Map<String, Object> jsonParamMap;
|
||||||
|
@ApiParam(value = "调用方法参数列表", allowEmptyValue = true)
|
||||||
|
private Object[] jsonParamArray;
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.client.bean.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ns
|
||||||
|
* @create 2021/5/26 0026 下午 17:41
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Api("参数的信息")
|
||||||
|
public class ParamInfo {
|
||||||
|
@ApiParam("参数名")
|
||||||
|
private String name;
|
||||||
|
@ApiParam("参数类型名")
|
||||||
|
private String typeName;
|
||||||
|
@ApiParam("参数类信息")
|
||||||
|
private Class clzz;
|
||||||
|
}
|
@ -0,0 +1,40 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.client.bean.po;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ns
|
||||||
|
* @create 2021/5/26 0026 下午 14:39
|
||||||
|
* 注册的方法信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Api("方法注册的参数列表")
|
||||||
|
public class MethodRegistryParam implements Serializable {
|
||||||
|
|
||||||
|
@ApiParam("方法名")
|
||||||
|
private String methodName;
|
||||||
|
@ApiParam("方法所在bean的名字")
|
||||||
|
private String beanName;
|
||||||
|
@ApiParam("方法调用所需要的key")
|
||||||
|
private String methodHandlerKey;
|
||||||
|
@ApiParam("方法参数列表")
|
||||||
|
private List<ParamDescription> parameterList;
|
||||||
|
@ApiParam("方法的版本")
|
||||||
|
private String version;
|
||||||
|
@ApiParam("方法影响了那些表")
|
||||||
|
private String[] affectTableClassName;
|
||||||
|
@ApiParam("方法的处理逻辑")
|
||||||
|
private String[] systemProcess;
|
||||||
|
@ApiParam("方法参数的验证逻辑")
|
||||||
|
private String[] validation;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,42 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.client.bean.po;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ns
|
||||||
|
* @create 2021/5/24 0024 上午 11:08
|
||||||
|
* 注册的参数信息
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Api("参数的注册信息")
|
||||||
|
public class ParamDescription implements Serializable {
|
||||||
|
@ApiParam("参数名")
|
||||||
|
private String name;
|
||||||
|
@ApiParam(value = "参数类型",defaultValue ="1" ,allowableValues = "0 或者 1")
|
||||||
|
private Integer type; //出参还是入参
|
||||||
|
@ApiParam("参数类型名")
|
||||||
|
private String typeName; //类型
|
||||||
|
//默认值
|
||||||
|
@ApiParam("参数默认值")
|
||||||
|
private String defaultValue;
|
||||||
|
//允许的值
|
||||||
|
@ApiParam("参数可选值")
|
||||||
|
private String[] allowableValues;
|
||||||
|
//是否必填
|
||||||
|
@ApiParam("参数是否必填")
|
||||||
|
private Boolean required;
|
||||||
|
//例子
|
||||||
|
@ApiParam("参数的例子")
|
||||||
|
private String example;
|
||||||
|
//是否可以为空
|
||||||
|
@ApiParam("参数是否可以为空")
|
||||||
|
private Boolean allowEmptyValue;
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.client.bean.po;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ns
|
||||||
|
* @create 2021/5/26 0026 下午 14:33
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Api("执行器注册的信息")
|
||||||
|
public class RegistryParam implements Serializable {
|
||||||
|
@ApiParam("执行器的名称")
|
||||||
|
private String appname;
|
||||||
|
@ApiParam("执行器的地址")
|
||||||
|
private String address;
|
||||||
|
@ApiParam("执行器注册的方法信息")
|
||||||
|
private List<MethodRegistryParam> methodRegistryParamList;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,56 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.common;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Castle
|
||||||
|
*/
|
||||||
|
public class ReturnT<T> implements Serializable {
|
||||||
|
public static final long serialVersionUID = 42L;
|
||||||
|
|
||||||
|
public static final int SUCCESS_CODE = 200;
|
||||||
|
public static final int FAIL_CODE = 500;
|
||||||
|
|
||||||
|
public static final ReturnT<String> SUCCESS = new ReturnT<String>(null);
|
||||||
|
public static final ReturnT<String> FAIL = new ReturnT<String>(FAIL_CODE, null);
|
||||||
|
|
||||||
|
private int code;
|
||||||
|
private String msg;
|
||||||
|
private T content;
|
||||||
|
|
||||||
|
public ReturnT(){}
|
||||||
|
public ReturnT(int code, String msg) {
|
||||||
|
this.code = code;
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ReturnT(T content) {
|
||||||
|
this.code = SUCCESS_CODE;
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCode() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
public void setCode(int code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
public String getMsg() {
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
public void setMsg(String msg) {
|
||||||
|
this.msg = msg;
|
||||||
|
}
|
||||||
|
public T getContent() {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
public void setContent(T content) {
|
||||||
|
this.content = content;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "ReturnT [code=" + code + ", msg=" + msg + ", content=" + content + "]";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.common.util;
|
||||||
|
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.GsonBuilder;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
|
||||||
|
import java.lang.reflect.ParameterizedType;
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/17 13:40
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public class GsonTool {
|
||||||
|
private static Gson gson = null;
|
||||||
|
|
||||||
|
static {
|
||||||
|
gson = new GsonBuilder().setDateFormat("yyyy-MM-dd HH:mm:ss").create();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Object 转成 json
|
||||||
|
*
|
||||||
|
* @param src
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public static String toJson(Object src) {
|
||||||
|
return gson.toJson(src);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json 转成 特定的cls的Object
|
||||||
|
*
|
||||||
|
* @param json
|
||||||
|
* @param classOfT
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> T fromJson(String json, Class<T> classOfT) {
|
||||||
|
return gson.fromJson(json, classOfT);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json 转成 特定的 rawClass<classOfT> 的Object
|
||||||
|
*
|
||||||
|
* @param json
|
||||||
|
* @param classOfT
|
||||||
|
* @param argClassOfT
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> T fromJson(String json, Class<T> classOfT, Class argClassOfT) {
|
||||||
|
Type type = new ParameterizedType4ReturnT(classOfT, new Class[]{argClassOfT});
|
||||||
|
return gson.fromJson(json, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ParameterizedType4ReturnT implements ParameterizedType {
|
||||||
|
private final Class raw;
|
||||||
|
private final Type[] args;
|
||||||
|
|
||||||
|
public ParameterizedType4ReturnT(Class raw, Type[] args) {
|
||||||
|
this.raw = raw;
|
||||||
|
this.args = args != null ? args : new Type[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type[] getActualTypeArguments() {
|
||||||
|
return args;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type getRawType() {
|
||||||
|
return raw;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type getOwnerType() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* json 转成 特定的cls的list
|
||||||
|
*
|
||||||
|
* @param json
|
||||||
|
* @param classOfT
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static <T> List<T> fromJsonList(String json, Class<T> classOfT) {
|
||||||
|
return gson.fromJson(
|
||||||
|
json,
|
||||||
|
new TypeToken<List<T>>() {
|
||||||
|
}.getType()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,149 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.common.util;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.bsp.common.ReturnT;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.net.ssl.*;
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.DataOutputStream;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
import java.security.cert.CertificateException;
|
||||||
|
import java.security.cert.X509Certificate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/17 13:37
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public class HttpUtils {
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(HttpUtils.class);
|
||||||
|
|
||||||
|
// trust-https start
|
||||||
|
private static void trustAllHosts(HttpsURLConnection connection) {
|
||||||
|
try {
|
||||||
|
SSLContext sc = SSLContext.getInstance("TLS");
|
||||||
|
sc.init(null, trustAllCerts, new java.security.SecureRandom());
|
||||||
|
SSLSocketFactory newFactory = sc.getSocketFactory();
|
||||||
|
|
||||||
|
connection.setSSLSocketFactory(newFactory);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
connection.setHostnameVerifier(new HostnameVerifier() {
|
||||||
|
@Override
|
||||||
|
public boolean verify(String hostname, SSLSession session) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {
|
||||||
|
@Override
|
||||||
|
public X509Certificate[] getAcceptedIssuers() {
|
||||||
|
return new X509Certificate[]{};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkClientTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException {
|
||||||
|
}
|
||||||
|
}};
|
||||||
|
// trust-https end
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* post
|
||||||
|
*
|
||||||
|
* @param url
|
||||||
|
* @param timeout
|
||||||
|
* @param requestObj
|
||||||
|
* @param returnTargClassOfT
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static ReturnT postBody(String url, int timeout, Object requestObj, Class returnTargClassOfT) {
|
||||||
|
HttpURLConnection connection = null;
|
||||||
|
BufferedReader bufferedReader = null;
|
||||||
|
try {
|
||||||
|
// connection
|
||||||
|
URL realUrl = new URL(url);
|
||||||
|
connection = (HttpURLConnection) realUrl.openConnection();
|
||||||
|
|
||||||
|
// trust-https
|
||||||
|
boolean useHttps = url.startsWith("https");
|
||||||
|
if (useHttps) {
|
||||||
|
HttpsURLConnection https = (HttpsURLConnection) connection;
|
||||||
|
trustAllHosts(https);
|
||||||
|
}
|
||||||
|
|
||||||
|
// connection setting
|
||||||
|
connection.setRequestMethod("POST");
|
||||||
|
connection.setDoOutput(true);
|
||||||
|
connection.setDoInput(true);
|
||||||
|
connection.setUseCaches(false);
|
||||||
|
connection.setReadTimeout(timeout * 1000);
|
||||||
|
connection.setConnectTimeout(3 * 1000);
|
||||||
|
connection.setRequestProperty("connection", "Keep-Alive");
|
||||||
|
connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
|
||||||
|
connection.setRequestProperty("Accept-Charset", "application/json;charset=UTF-8");
|
||||||
|
|
||||||
|
// do connection
|
||||||
|
connection.connect();
|
||||||
|
|
||||||
|
// write requestBody
|
||||||
|
if (requestObj != null) {
|
||||||
|
String requestBody = GsonTool.toJson(requestObj);
|
||||||
|
|
||||||
|
DataOutputStream dataOutputStream = new DataOutputStream(connection.getOutputStream());
|
||||||
|
dataOutputStream.write(requestBody.getBytes("UTF-8"));
|
||||||
|
dataOutputStream.flush();
|
||||||
|
dataOutputStream.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
// valid StatusCode
|
||||||
|
int statusCode = connection.getResponseCode();
|
||||||
|
if (statusCode != 200) {
|
||||||
|
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, "rpc remoting fail, StatusCode(" + statusCode + ") invalid. for url : " + url);
|
||||||
|
}
|
||||||
|
|
||||||
|
// result
|
||||||
|
bufferedReader = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF-8"));
|
||||||
|
StringBuilder result = new StringBuilder();
|
||||||
|
String line;
|
||||||
|
while ((line = bufferedReader.readLine()) != null) {
|
||||||
|
result.append(line);
|
||||||
|
}
|
||||||
|
String resultJson = result.toString();
|
||||||
|
// parse returnT
|
||||||
|
try {
|
||||||
|
return GsonTool.fromJson(resultJson, ReturnT.class);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("rpc remoting (url=" + url + ") response content invalid(" + resultJson + ").", e);
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, "rpc remoting (url=" + url + ") response content invalid(" + resultJson + ").");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error(e.getMessage(), e);
|
||||||
|
return new ReturnT<String>(ReturnT.FAIL_CODE, "rpc remoting error(" + e.getMessage() + "), for url : " + url);
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
if (bufferedReader != null) {
|
||||||
|
bufferedReader.close();
|
||||||
|
}
|
||||||
|
if (connection != null) {
|
||||||
|
connection.disconnect();
|
||||||
|
}
|
||||||
|
} catch (Exception e2) {
|
||||||
|
logger.error(e2.getMessage(), e2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.bean.model;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :执行器注册参数
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/11 16:57
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Api("注册/心跳")
|
||||||
|
public class RegistryMessageInfo {
|
||||||
|
|
||||||
|
@ApiParam("appName,根据appName分执行器组")
|
||||||
|
private String appName;
|
||||||
|
|
||||||
|
@ApiParam("执行器地址")
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
@ApiParam("方法列表")
|
||||||
|
private List<RegistryMethodInfo> methodRegistryParamList;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,51 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.bean.po;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/16 13:39
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Table(name = "EXECUTOR_REGISTRY_METHOD_INFO")
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@ApiModel("方法注册信息")
|
||||||
|
public class ExecutorRegistryMethodInfo extends BaseBean implements Serializable {
|
||||||
|
private static final long serialVersionUID = 2096630767822598366L;
|
||||||
|
|
||||||
|
@Column(name = "METHOD_NAME")
|
||||||
|
@ApiModelProperty("方法名")
|
||||||
|
private String methodName;
|
||||||
|
|
||||||
|
@Column(name = "METHOD_HANDLER_KEY")
|
||||||
|
@ApiModelProperty("调用方法需要的key")
|
||||||
|
private String methodHandlerKey;
|
||||||
|
|
||||||
|
@Column(name = "BEAN_NAME")
|
||||||
|
@ApiModelProperty("beanName")
|
||||||
|
private String beanName;
|
||||||
|
|
||||||
|
@Column(name = "VERSION")
|
||||||
|
@ApiModelProperty("方法的版本号")
|
||||||
|
private String version;
|
||||||
|
|
||||||
|
@Column(name = "APP_NAME")
|
||||||
|
@ApiModelProperty("所属执行器的appName")
|
||||||
|
private String appName;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,48 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.bean.po;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/16 13:36
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Entity
|
||||||
|
@Table(name = "EXECUTOR_REGISTRY_PARAM_INFO")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@ApiModel("方法注册参数信息")
|
||||||
|
public class ExecutorRegistryParamInfo extends BaseBean implements Serializable {
|
||||||
|
private static final long serialVersionUID = 7346454749822492424L;
|
||||||
|
|
||||||
|
|
||||||
|
@Column(name = "NAME")
|
||||||
|
@ApiModelProperty("参数名")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
@Column(name = "TYPE")
|
||||||
|
@ApiModelProperty("入参 1 ,出参 0")
|
||||||
|
private Integer type;
|
||||||
|
|
||||||
|
@Column(name = "TYPE_NAME")
|
||||||
|
@ApiModelProperty("数据类型,基本数据类型")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@Column(name = "METHOD_ID")
|
||||||
|
@ApiModelProperty("所属方法的ID")
|
||||||
|
private Long methodId;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.bsp.server.bean.po.ExecutorGroupRegistryInfo;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/16 14:49
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Repository
|
||||||
|
public interface ExecutorGroupRegistryInfoRepository extends BaseRepository<ExecutorGroupRegistryInfo,Long> {
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.bsp.server.bean.po.ExecutorRegistryInfo;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/16 14:51
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Repository
|
||||||
|
public interface ExecutorRegistryInfoRepository extends BaseRepository<ExecutorRegistryInfo,Long> {
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.bsp.server.bean.po.ExecutorRegistryMethodDocInfo;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/16 14:53
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Repository
|
||||||
|
public interface ExecutorRegistryMethodDocInfoRepository extends BaseRepository<ExecutorRegistryMethodDocInfo,Long> {
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.bsp.server.bean.po.ExecutorRegistryMethodInfo;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/16 14:55
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Repository
|
||||||
|
public interface ExecutorRegistryMethodInfoRepository extends BaseRepository<ExecutorRegistryMethodInfo,Long> {
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.repository;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.bsp.server.bean.po.ExecutorRegistryParamInfo;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2021/6/16 14:58
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Repository
|
||||||
|
public interface ExecutorRegistryParamInfoRepository extends BaseRepository<ExecutorRegistryParamInfo,Long> {
|
||||||
|
}
|
Loading…
Reference in New Issue