软适配 WebService 功能开发

yun-zuoyi
wei.peng 6 years ago
parent e58aaf95b9
commit 5b200f824f

@ -10,19 +10,19 @@ import org.apache.commons.lang3.StringUtils;
* @CreateDate : 2019-08-13 9:34
* @Modify:
**/
public class SoftSwitchEnumUtil {
public class BlockSoftSwitchEnumUtil {
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum CASE_TYPE{
SOCKET(1,"SOCKET"),
RESTFUL(2,"RESTFUL"),
DATASOURCE(3,"数据源"),
WEBSERVICE(4,"WebService"),
MQ(5,"消息队列"),
WebSocket(6,"WebSocket");
SOCKET(10,"SOCKET"),
RESTFUL(20,"RESTFUL"),
DATASOURCE(30,"数据源"),
WEBSERVICE(40,"WebService"),
MQ(50,"消息队列"),
WebSocket(60,"WebSocket");
private int value;
private String description;
@ -57,7 +57,8 @@ public class SoftSwitchEnumUtil {
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum REQUEST_SOURCE{
ACTIVE(1,"主动请求"),
SCHEDULE(2,"定时调度");
SCHEDULE(2,"定时调度"),
RABBITMQ(3,"MQ 调用");
private int value;
private String description;
@ -234,7 +235,7 @@ public class SoftSwitchEnumUtil {
return tmp;
}
public static SoftSwitchEnumUtil.DATA_SOURCE_TYPE valueOf(int val) {
public static BlockSoftSwitchEnumUtil.DATA_SOURCE_TYPE valueOf(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
@ -267,7 +268,7 @@ public class SoftSwitchEnumUtil {
return null;
}
public static SoftSwitchEnumUtil.DATA_SOURCE_TYPE getDataSourceURL(String databaseProductName){
public static BlockSoftSwitchEnumUtil.DATA_SOURCE_TYPE getDataSourceURL(String databaseProductName){
if(StringUtils.isNotBlank(databaseProductName)){
if(databaseProductName.indexOf(":mysql:") != -1){
return SOURCE_MARIA_DB;
@ -304,11 +305,11 @@ public class SoftSwitchEnumUtil {
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum PARAM_VALUE_TYPE{
NUM(1,"数字"),
STRING(2,"字符串"),
BOOLEAN(3,"布尔"),
MAP(4,"字典"),
LIST(5,"列表");
NUM(10,"数字"),
STRING(20,"字符串"),
BOOLEAN(30,"布尔"),
MAP(40,"字典"),
LIST(50,"列表");
private int value;
private String description;
@ -378,8 +379,8 @@ public class SoftSwitchEnumUtil {
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SUIT_MODE{
ACTIVE(1,"主动"),
PASSIVE(2,"被动");
ACTIVE(1,"客户端"),
PASSIVE(2,"服务端");
private int value;
private String description;
@ -443,4 +444,39 @@ public class SoftSwitchEnumUtil {
}
}
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum SUIT_SERVER_WEB_SERVICE{
ACTIVE(40001,"hello"),
SCHEDULE(40002,"邮件测试");
private int value;
private String description;
SUIT_SERVER_WEB_SERVICE(int value, String description) {
this.value = value;
this.description = description;
}
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
public static String valueOfDescription(int val) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].value == val) {
tmp = values()[i].description;
}
}
return tmp;
}
}
}

@ -61,6 +61,10 @@ public class BsSuitCase extends BaseBean {
@ApiParam(value = "适配模式(枚举,主动,被动)")
private Integer suitModeId;
@Column(name = "SUIT_SERVER_ACTION")
@ApiParam(value = "Server 适配命令")
private String suitServerAction;
@Column(name = "SUIT_CASE_HOST")
@ApiParam(value = "适配主机")
private String suitCaseHost;

@ -0,0 +1,46 @@
package cn.estsh.i3plus.pojo.softswitch.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description : WebService
* @Reference :
* @Author : wei.peng
* @CreateDate : 2019/9/9 11:09
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BS_SUIT_CASE_WEB_SERVICE")
@Api(value = "WebService", description = "WebService 适配套件")
public class BsSuitCaseWebService extends BaseBean {
@Column(name = "SUIT_CASE_ID")
@ApiParam(value = "套件id")
@JsonSerialize(using = ToStringSerializer.class)
private Long suitCaseId;
@Column(name = "SERVICE_TAG_NAME")
@ApiParam(value = "Service Tag Name(包名称)")
private String serviceTagName;
@Column(name = "SERVICE_FUNCTION_NAME")
@ApiParam(value = "Service Function Name(方法名称)")
private String serviceFunctionName;
}

@ -0,0 +1,14 @@
package cn.estsh.i3plus.pojo.softswitch.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.softswitch.bean.BsSuitCaseWebService;
/**
* @Description :
* @Reference :
* @Author : wei.peng
* @CreateDate : 2019/9/9 11:41
* @Modify:
**/
public interface BsSuitCaseWebServiceRepository extends BaseRepository<BsSuitCaseWebService,Long> {
}
Loading…
Cancel
Save