Merge branch 'ext-dev' of http://git.estsh.com/i3-IMPP/i3plus-pojo into ext-dev
commit
a212e8591a
@ -1,11 +0,0 @@
|
|||||||
package cn.estsh.i3plus.pojo.bsp.common;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description :
|
|
||||||
* @Reference :
|
|
||||||
* @Author : Castle
|
|
||||||
* @CreateDate : 2021/7/22 15:38
|
|
||||||
* @Modify:
|
|
||||||
**/
|
|
||||||
public class GroovyCommonUtil {
|
|
||||||
}
|
|
@ -1,98 +0,0 @@
|
|||||||
package cn.estsh.i3plus.pojo.bsp.common;
|
|
||||||
|
|
||||||
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()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,149 +0,0 @@
|
|||||||
//package cn.estsh.i3plus.pojo.bsp.common;
|
|
||||||
//
|
|
||||||
//import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
|
|
||||||
//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
|
|
||||||
// * @return
|
|
||||||
// */
|
|
||||||
// public static ResultBean postBody(String url, int timeout, Object requestObj) {
|
|
||||||
// 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 ResultBean.fail("rpc remoting fail, StatusCode(" + statusCode + ") invalid. for url : " + url);
|
|
||||||
//// return new BaseResultBean().errorMsg("rpc remoting fail, StatusCode(" + statusCode + ") invalid. for url : " + url);
|
|
||||||
//// 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, BaseResultBean.class);
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// logger.error("rpc remoting (url=" + url + ") response content invalid(" + resultJson + ").", e);
|
|
||||||
// return ResultBean.fail("rpc remoting fail, StatusCode(" + statusCode + ") invalid. for url : " + url);
|
|
||||||
// }
|
|
||||||
// } catch (Exception e) {
|
|
||||||
// logger.error(e.getMessage(), e);
|
|
||||||
// return ResultBean.fail("rpc remoting fail, error message(" + e.getMessage() + ") invalid. for url : " + url);
|
|
||||||
// } finally {
|
|
||||||
// try {
|
|
||||||
// if (bufferedReader != null) {
|
|
||||||
// bufferedReader.close();
|
|
||||||
// }
|
|
||||||
// if (connection != null) {
|
|
||||||
// connection.disconnect();
|
|
||||||
// }
|
|
||||||
// } catch (Exception e2) {
|
|
||||||
// logger.error(e2.getMessage(), e2);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//}
|
|
@ -1,56 +0,0 @@
|
|||||||
//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,26 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2022/1/24 16:27
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@ApiModel(value = "methodGroup通用vo")
|
||||||
|
public class MethodGroupCommonVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "方法组的id")
|
||||||
|
private List<Long> ids;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "方法组启用禁用")
|
||||||
|
private Integer isValid;
|
||||||
|
}
|
@ -0,0 +1,19 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2022/1/22 19:23
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@ApiModel("deletedVO")
|
||||||
|
public class ScriptDeleteVo {
|
||||||
|
private List<Long> ids;
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.bean.vo;
|
||||||
|
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2022/1/19 11:39
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@ApiModel(value = "查询脚本vo")
|
||||||
|
@Data
|
||||||
|
public class ScriptVo {
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "脚本名称")
|
||||||
|
private String scriptName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "脚本状态")
|
||||||
|
private Integer isValid;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "脚本语言")
|
||||||
|
private Integer scriptLanguage;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "脚本No,唯一")
|
||||||
|
private String scriptNo;
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package cn.estsh.i3plus.pojo.bsp.server.dao;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.bsp.client.bean.po.EngineScriptPersistence;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description :
|
||||||
|
* @Reference :
|
||||||
|
* @Author : Castle
|
||||||
|
* @CreateDate : 2022/1/18 11:23
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public interface IEngineScriptDao {
|
||||||
|
/**
|
||||||
|
* 根据脚本名称获取所有的版本号
|
||||||
|
* @param name
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<EngineScriptPersistence> findAllVersionByScriptName(String name);
|
||||||
|
}
|
Loading…
Reference in New Issue