冷热数据分离--重构

yun-zuoyi
castle.zang 3 years ago
parent c2437fd00f
commit 94c61f77f4

@ -1642,34 +1642,34 @@ public class ImppEnumUtil {
}
}
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum DATA_SEPARATOR_STRATEGY{
MYSQL(10,"mysql","dataSeparatorStrategyMysql","迁移数据到mysql");
private final int value;
private final String code;
private final String strategyName;
private final String description;
DATA_SEPARATOR_STRATEGY(int value,String code,String strategyName,String description){
this.value = value;
this.code = code;
this.strategyName = strategyName;
this.description = description;
}
public String getCode() {
return code;
}
public static String codeOfStrategyName(String code) {
String tmp = null;
for (int i = 0; i < values().length; i++) {
if (values()[i].code.equals(code)) {
tmp = values()[i].strategyName;
}
}
return tmp;
}
}
// @JsonFormat(shape = JsonFormat.Shape.OBJECT)
// public enum DATA_SEPARATOR_STRATEGY{
// MYSQL(10,"mysql","dataSeparatorStrategyMysql","迁移数据到mysql");
// private final int value;
// private final String code;
// private final String strategyName;
// private final String description;
// DATA_SEPARATOR_STRATEGY(int value,String code,String strategyName,String description){
// this.value = value;
// this.code = code;
// this.strategyName = strategyName;
// this.description = description;
// }
//
// public String getCode() {
// return code;
// }
//
// public static String codeOfStrategyName(String code) {
// String tmp = null;
// for (int i = 0; i < values().length; i++) {
// if (values()[i].code.equals(code)) {
// tmp = values()[i].strategyName;
// }
// }
// return tmp;
// }
// }
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum AUTH_LOGIN_STRATEGY {

@ -0,0 +1,90 @@
package cn.estsh.i3plus.pojo.platform.bean;
import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/7 10:44
* @Modify:
**/
@Data
@NoArgsConstructor
@DynamicInsert
@DynamicUpdate
@Entity
@Table(name = "ORE_DATA_SOURCE")
public class CoreDataSource extends BaseBean{
@Column(
name = "SOURCE_NAME"
)
@ApiParam("数据源名称")
private String sourceName;
@Column(
name = "SOURCE_CODE"
)
@ApiParam("数据源编码")
private String sourceCode;
@Column(
name = "SOURCE_STATUS"
)
@ApiParam(
value = "数据源状态",
name = "状态:可用,不可用 看枚举当中是否存在"
)
private Integer sourceStatus;
@Column(
name = "SOURCE_TYPE"
)
@ApiParam(
value = "数据源类型",
name = "BlockFormEnumUtil.DATA_SOURCE_TYPE"
)
private Integer sourceType;
@Column(
name = "SOURCE_HOST"
)
@ApiParam("数据源连接地址")
private String sourceHost;
@Column(
name = "SOURCE_PORT"
)
@ApiParam("数据源端口")
private Integer sourcePort;
@Column(
name = "SOURCE_DATA_BASE_NAME"
)
@ApiParam("数据库名称")
private String sourceDataBaseName;
@Column(
name = "SOURCE_USER_NAME"
)
@ApiParam("数据库用户名称")
private String sourceUserName;
@Column(
name = "SOURCE_PASSWORD"
)
@ApiParam("数据库用户密码")
private String sourcePassword;
@Column(
name = "SOURCE_DESCRIPTION"
)
@ApiParam("数据源描述")
private String sourceDescription;
public CoreDataSource(Long id, String sourceName) {
this.id = id;
this.sourceCode = sourceName;
}
}

@ -26,29 +26,14 @@ public class DataSeparatorMessage implements Serializable {
*
*/
private String refClass;
/**
* eg: mysql,sqlServer,es
*/
private String destUrl;
/**
*
*/
private String userName;
/**
*
*/
private String password;
/**
*
*/
private String destTableName;
/**
* esmysql,sqlserver
*/
private String classification;
/**
*
* id
*/
private String databaseName;
private Long destDataSourceId;
}

@ -35,11 +35,6 @@ public class DataSeparatorRule extends BaseBean {
@ApiParam(value = "具体的数字,作为迁移标准")
private String rule;
@Column(name = "CLASSIFICATION")
@ApiParam(value = "迁移分类是迁移到mysql,sqlserver,ES 等做区分")
private String classification;
@Column(name = "REF_BEAN_NAME")
@ApiParam(value = "迁移的类的名称")
private String refBeanName;
@ -49,20 +44,9 @@ public class DataSeparatorRule extends BaseBean {
@ApiParam(value = "迁移目的地的表名")
private String tableNameDest;
@Column(name = "IP")
@ApiParam(value = "目标位置的ip")
private String ip;
@Column(name = "USER_NAME")
@ApiParam(value = "目标库的用户名")
private String userName;
@Column(name = "PASSWORD")
@ApiParam(value = "目标库的密码")
private String password;
@Column(name = "DEST_DATA_SOURCE_ID")
@ApiParam(value = "目的数据源id")
private Long destDataSourceId;
@Column(name = "DATABASE_NAME")
@ApiParam(value = "目标库名")
private String databaseName;
}

@ -0,0 +1,16 @@
package cn.estsh.i3plus.pojo.platform.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.platform.bean.CoreDataSource;
import org.springframework.stereotype.Repository;
/**
* @Description :
* @Reference :
* @Author : Castle
* @CreateDate : 2022/1/7 13:18
* @Modify:
**/
@Repository
public interface CoreDataSourceRepository extends BaseRepository<CoreDataSource,Long> {
}

@ -82,8 +82,8 @@ public class CusDatasource extends BaseBean {
@ApiParam("数据源描述")
private String sourceDescription;
public CusDatasource(Long id, String sourceCode) {
public CusDatasource(Long id, String sourceName) {
this.id = id;
this.sourceCode = sourceCode;
this.sourceName = sourceName;
}
}

Loading…
Cancel
Save