数据脱敏

dev.csh.oneweek
陈思豪 2024-08-21 20:48:50 +08:00
parent 37c71a5d3e
commit 3dc7b35e04
27 changed files with 1130 additions and 266 deletions

View File

@ -1,11 +1,18 @@
# 指定构建镜像的起始镜像
FROM anolis-registry.cn-zhangjiakou.cr.aliyuncs.com/openanolis/dragonwell:17.0.4.0.4.8-standard-ga-8.6
# 执行一些必须的条件
# 定义时区参数
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo '$TZ' > /etc/timezone
# 执行一些必备的条件
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo "$TZ" > /etc/timezone
VOLUME ["/home/logs/cloud-etl"]
# 挂载工作目录
VOLUME ["/home/logs"]
# 拷贝执行 jar 包文件
COPY ./cloud-etl-server/target/cloud-etl.jar /home/app.jar
ENTRYPOINT ["java","-jar"]CMD ["/home/app.jar"]
# 构建启动命令
ENTRYPOINT ["java", "-Dfile.encoding=utf-8", "-jar", "/home/app.jar"]

View File

@ -9,16 +9,16 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
import java.util.Map;
/**
* asset_data_dict
*
* @author Saisai
* @date 2024-04-24
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class AssetDataDict extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -31,6 +31,72 @@ public class AssetDataDict extends BaseEntity
@Excel(name = "数据接入id")
private Long basicId;
@Override
public String toString() {
return "AssetDataDict{" +
"id=" + id +
", basicId=" + basicId +
", dictName='" + dictName + '\'' +
", dictType='" + dictType + '\'' +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getBasicId() {
return basicId;
}
public void setBasicId(Long basicId) {
this.basicId = basicId;
}
public String getDictName() {
return dictName;
}
public void setDictName(String dictName) {
this.dictName = dictName;
}
public String getDictType() {
return dictType;
}
public void setDictType(String dictType) {
this.dictType = dictType;
}
public AssetDataDict(BaseEntityBuilder<?, ?> b, Long id, Long basicId, String dictName, String dictType) {
super(b);
this.id = id;
this.basicId = basicId;
this.dictName = dictName;
this.dictType = dictType;
}
public AssetDataDict(Long id, Long basicId, String dictName, String dictType) {
this.id = id;
this.basicId = basicId;
this.dictName = dictName;
this.dictType = dictType;
}
public AssetDataDict(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map<String, Object> params, Long id, Long basicId, String dictName, String dictType) {
super(searchValue, createBy, createTime, updateBy, updateTime, remark, params);
this.id = id;
this.basicId = basicId;
this.dictName = dictName;
this.dictType = dictType;
}
/** 字典名称 */
@Excel(name = "字典名称")
private String dictName;

View File

@ -7,16 +7,16 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
import java.util.Map;
/**
* asset_impower
*
* @author Saisai
* @date 2024-04-28
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class AssetImpower extends BaseEntity {
private static final long serialVersionUID = 1L;
@ -25,6 +25,57 @@ public class AssetImpower extends BaseEntity {
*/
private Long id;
@Override
public String toString() {
return "AssetImpower{" +
"id=" + id +
", tableId=" + tableId +
", deptId=" + deptId +
", basicId=" + basicId +
", userId=" + userId +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getTableId() {
return tableId;
}
public void setTableId(Long tableId) {
this.tableId = tableId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getBasicId() {
return basicId;
}
public void setBasicId(Long basicId) {
this.basicId = basicId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
/**
* id
*/
@ -49,14 +100,40 @@ public class AssetImpower extends BaseEntity {
@Excel(name = "用户id")
private Long userId;
public static AssetImpower saveAssetImpower
(Long deptId,Long userId,AssetImpower assetImpower){
return AssetImpower.builder()
.basicId(assetImpower.getBasicId())
.tableId(assetImpower.getTableId())
.deptId(deptId)
.userId(userId)
.build();
public AssetImpower(BaseEntityBuilder<?, ?> b, Long id, Long tableId, Long deptId, Long basicId, Long userId) {
super(b);
this.id = id;
this.tableId = tableId;
this.deptId = deptId;
this.basicId = basicId;
this.userId = userId;
}
public AssetImpower(Long id, Long tableId, Long deptId, Long basicId, Long userId) {
this.id = id;
this.tableId = tableId;
this.deptId = deptId;
this.basicId = basicId;
this.userId = userId;
}
public AssetImpower(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map<String, Object> params, Long id, Long tableId, Long deptId, Long basicId, Long userId) {
super(searchValue, createBy, createTime, updateBy, updateTime, remark, params);
this.id = id;
this.tableId = tableId;
this.deptId = deptId;
this.basicId = basicId;
this.userId = userId;
}
// public static AssetImpower saveAssetImpower
// (Long deptId,Long userId,AssetImpower assetImpower){
// return AssetImpower.builder()
// .basicId(assetImpower.getBasicId())
// .tableId(assetImpower.getTableId())
// .deptId(deptId)
// .userId(userId)
// .build();
// }
}

View File

@ -10,20 +10,30 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
import java.util.Map;
/**
* dict_info
*
* @author Saisai
* @date 2024-04-24
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class DictInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
@Override
public String toString() {
return "DictInfo{" +
"id=" + id +
", dictId=" + dictId +
", infoName='" + infoName + '\'' +
", infoValue='" + infoValue + '\'' +
", isEdit=" + isEdit +
'}';
}
/** 主键 */
@TableId(value = "id",type = IdType.AUTO)
private Long id;
@ -32,6 +42,72 @@ public class DictInfo extends BaseEntity
@Excel(name = "字典id")
private Long dictId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getDictId() {
return dictId;
}
public void setDictId(Long dictId) {
this.dictId = dictId;
}
public String getInfoName() {
return infoName;
}
public void setInfoName(String infoName) {
this.infoName = infoName;
}
public String getInfoValue() {
return infoValue;
}
public void setInfoValue(String infoValue) {
this.infoValue = infoValue;
}
public boolean isEdit() {
return isEdit;
}
public void setEdit(boolean edit) {
isEdit = edit;
}
public DictInfo(BaseEntityBuilder<?, ?> b, Long id, Long dictId, String infoName, String infoValue, boolean isEdit) {
super(b);
this.id = id;
this.dictId = dictId;
this.infoName = infoName;
this.infoValue = infoValue;
this.isEdit = isEdit;
}
public DictInfo(Long id, Long dictId, String infoName, String infoValue, boolean isEdit) {
this.id = id;
this.dictId = dictId;
this.infoName = infoName;
this.infoValue = infoValue;
this.isEdit = isEdit;
}
public DictInfo(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map<String, Object> params, Long id, Long dictId, String infoName, String infoValue, boolean isEdit) {
super(searchValue, createBy, createTime, updateBy, updateTime, remark, params);
this.id = id;
this.dictId = dictId;
this.infoName = infoName;
this.infoValue = infoValue;
this.isEdit = isEdit;
}
/** 字典名称 */
@Excel(name = "字典名称")
private String infoName;

View File

@ -14,14 +14,110 @@ import java.util.Date;
* @nameDictionary
* @Date2024/8/21 10:31
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class Dictionary {
private Integer createBy;
private Date createTime;
private Integer updateBy;
@Override
public String toString() {
return "Dictionary{" +
"createBy=" + createBy +
", createTime=" + createTime +
", updateBy=" + updateBy +
", updateTime=" + updateTime +
", remark='" + remark + '\'' +
", id=" + id +
", code='" + code + '\'' +
", descriotion='" + descriotion + '\'' +
", typeId=" + typeId +
'}';
}
public Integer getCreateBy() {
return createBy;
}
public void setCreateBy(Integer createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Integer getUpdateBy() {
return updateBy;
}
public void setUpdateBy(Integer updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getDescriotion() {
return descriotion;
}
public void setDescriotion(String descriotion) {
this.descriotion = descriotion;
}
public Integer getTypeId() {
return typeId;
}
public void setTypeId(Integer typeId) {
this.typeId = typeId;
}
public Dictionary(Integer createBy, Date createTime, Integer updateBy, Date updateTime, String remark, Long id, String code, String descriotion, Integer typeId) {
this.createBy = createBy;
this.createTime = createTime;
this.updateBy = updateBy;
this.updateTime = updateTime;
this.remark = remark;
this.id = id;
this.code = code;
this.descriotion = descriotion;
this.typeId = typeId;
}
private Date updateTime;
private String remark;
private Long id;

View File

@ -13,11 +13,36 @@ import lombok.experimental.SuperBuilder;
* @nameDictionaryTYpe
* @Date2024/8/21 10:32
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class DictionaryTYpe {
private Long id;
private String typeName;
@Override
public String toString() {
return "DictionaryTYpe{" +
"id=" + id +
", typeName='" + typeName + '\'' +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
public DictionaryTYpe(Long id, String typeName) {
this.id = id;
this.typeName = typeName;
}
}

View File

@ -3,6 +3,7 @@ package com.muyu.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
@ -11,8 +12,8 @@ import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
@Data
@NoArgsConstructor
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@TableName(value ="source",autoResultMap = true) //数据库表相关
@ -21,70 +22,54 @@ public class Source extends BaseEntity {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
*
*/
/** 接入源名称 */
@Excel(name = "接入源名称")
private String dataResourceName;
/**
*
*/
/** 数据来源系统名称 */
@Excel(name = "数据来源系统名称")
private String dataSourcesSystemName;
/**
* Ip
*/
/** 主机ip地址 */
@Excel(name = "主机ip地址")
private String host;
/**
*
*/
/** 端口 */
@Excel(name = "端口")
private String port;
/**
*
*/
/** 数据接入类型 */
@Excel(name = "数据接入类型")
private String databaseType;
/**
*
*/
/** 数据库名称 */
@Excel(name = "数据库名称")
private String databaseName;
/**
*
*/
/** 初始化连接数量 */
@Excel(name = "初始化连接数量")
private Long initLinkNum;
/**
*
*/
/** 最大连接数量 */
@Excel(name = "最大连接数量")
private Long maxLinkNum;
/**
*
*/
/** 最大等待时间 */
@Excel(name = "最大等待时间")
private Long maxWaitTime;
/**
*
*/
/** 最大等待次数 */
@Excel(name = "最大等待次数")
private Long maxWaitTimes;
/**
*
*/
@Excel(name ="连接参数")
private String connectionParams;
/**
*
*/
@Excel(name ="用户名")
private String username;
/**
*
*/
@Excel(name ="密码")
private String password;
}

View File

@ -1,5 +1,6 @@
package com.muyu.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
@ -13,11 +14,19 @@ import lombok.experimental.SuperBuilder;
@NoArgsConstructor
@SuperBuilder
@EqualsAndHashCode(callSuper = true)
@TableName(value ="SourceType",autoResultMap = true) //数据库表相关
@TableName(value ="sourcetype",autoResultMap = true) //数据库表相关
public class SourceType extends BaseEntity {
private static final long serialVersionUID = 1L;
//数据源类型ID
private Integer id;
//数据源类型名称
private String name;
//
@TableField(value = "driver_class")
private String driverClass;
private String prefix;
private String suffix;
}

View File

@ -9,16 +9,15 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
import java.util.Map;
/**
* structure
*
* @author Saisai
* @date 2024-04-22
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class Structure extends BaseEntity
{
private static final long serialVersionUID = 1L;
@ -76,4 +75,176 @@ public class Structure extends BaseEntity
private String dictionaryTable;
@Override
public String toString() {
return "Structure{" +
"id=" + id +
", tableId=" + tableId +
", columnName='" + columnName + '\'' +
", columnRemark='" + columnRemark + '\'' +
", isPrimary='" + isPrimary + '\'' +
", columnType='" + columnType + '\'' +
", javaType='" + javaType + '\'' +
", columnLength='" + columnLength + '\'' +
", columnDecimals='" + columnDecimals + '\'' +
", isNull='" + isNull + '\'' +
", defaultValue='" + defaultValue + '\'' +
", isDictionary='" + isDictionary + '\'' +
", dictionaryTable='" + dictionaryTable + '\'' +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getTableId() {
return tableId;
}
public void setTableId(Long tableId) {
this.tableId = tableId;
}
public String getColumnName() {
return columnName;
}
public void setColumnName(String columnName) {
this.columnName = columnName;
}
public String getColumnRemark() {
return columnRemark;
}
public void setColumnRemark(String columnRemark) {
this.columnRemark = columnRemark;
}
public String getIsPrimary() {
return isPrimary;
}
public void setIsPrimary(String isPrimary) {
this.isPrimary = isPrimary;
}
public String getColumnType() {
return columnType;
}
public void setColumnType(String columnType) {
this.columnType = columnType;
}
public String getJavaType() {
return javaType;
}
public void setJavaType(String javaType) {
this.javaType = javaType;
}
public String getColumnLength() {
return columnLength;
}
public void setColumnLength(String columnLength) {
this.columnLength = columnLength;
}
public String getColumnDecimals() {
return columnDecimals;
}
public void setColumnDecimals(String columnDecimals) {
this.columnDecimals = columnDecimals;
}
public String getIsNull() {
return isNull;
}
public void setIsNull(String isNull) {
this.isNull = isNull;
}
public String getDefaultValue() {
return defaultValue;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
public String getIsDictionary() {
return isDictionary;
}
public void setIsDictionary(String isDictionary) {
this.isDictionary = isDictionary;
}
public String getDictionaryTable() {
return dictionaryTable;
}
public void setDictionaryTable(String dictionaryTable) {
this.dictionaryTable = dictionaryTable;
}
public Structure(BaseEntityBuilder<?, ?> b, Long id, Long tableId, String columnName, String columnRemark, String isPrimary, String columnType, String javaType, String columnLength, String columnDecimals, String isNull, String defaultValue, String isDictionary, String dictionaryTable) {
super(b);
this.id = id;
this.tableId = tableId;
this.columnName = columnName;
this.columnRemark = columnRemark;
this.isPrimary = isPrimary;
this.columnType = columnType;
this.javaType = javaType;
this.columnLength = columnLength;
this.columnDecimals = columnDecimals;
this.isNull = isNull;
this.defaultValue = defaultValue;
this.isDictionary = isDictionary;
this.dictionaryTable = dictionaryTable;
}
public Structure(Long id, Long tableId, String columnName, String columnRemark, String isPrimary, String columnType, String javaType, String columnLength, String columnDecimals, String isNull, String defaultValue, String isDictionary, String dictionaryTable) {
this.id = id;
this.tableId = tableId;
this.columnName = columnName;
this.columnRemark = columnRemark;
this.isPrimary = isPrimary;
this.columnType = columnType;
this.javaType = javaType;
this.columnLength = columnLength;
this.columnDecimals = columnDecimals;
this.isNull = isNull;
this.defaultValue = defaultValue;
this.isDictionary = isDictionary;
this.dictionaryTable = dictionaryTable;
}
public Structure(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map<String, Object> params, Long id, Long tableId, String columnName, String columnRemark, String isPrimary, String columnType, String javaType, String columnLength, String columnDecimals, String isNull, String defaultValue, String isDictionary, String dictionaryTable) {
super(searchValue, createBy, createTime, updateBy, updateTime, remark, params);
this.id = id;
this.tableId = tableId;
this.columnName = columnName;
this.columnRemark = columnRemark;
this.isPrimary = isPrimary;
this.columnType = columnType;
this.javaType = javaType;
this.columnLength = columnLength;
this.columnDecimals = columnDecimals;
this.isNull = isNull;
this.defaultValue = defaultValue;
this.isDictionary = isDictionary;
this.dictionaryTable = dictionaryTable;
}
}

View File

@ -9,16 +9,14 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
* table_info
*
* @author Saisai
* @date 2024-04-22
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class TableInfo extends TreeEntity
{
private static final long serialVersionUID = 1L;
@ -30,6 +28,121 @@ public class TableInfo extends TreeEntity
private Long basicId;
@Override
public String toString() {
return "TableInfo{" +
"id=" + id +
", basicId=" + basicId +
", tableName='" + tableName + '\'' +
", tableRemark='" + tableRemark + '\'' +
", type='" + type + '\'' +
", dataNum=" + dataNum +
", center='" + center + '\'' +
", parentId=" + parentId +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getBasicId() {
return basicId;
}
public void setBasicId(Long basicId) {
this.basicId = basicId;
}
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public String getTableRemark() {
return tableRemark;
}
public void setTableRemark(String tableRemark) {
this.tableRemark = tableRemark;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public Long getDataNum() {
return dataNum;
}
public void setDataNum(Long dataNum) {
this.dataNum = dataNum;
}
public String getCenter() {
return center;
}
public void setCenter(String center) {
this.center = center;
}
@Override
public Long getParentId() {
return parentId;
}
@Override
public void setParentId(Long parentId) {
this.parentId = parentId;
}
public TableInfo(TreeEntityBuilder<?, ?> b, Long id, Long basicId, String tableName, String tableRemark, String type, Long dataNum, String center, Long parentId) {
super(b);
this.id = id;
this.basicId = basicId;
this.tableName = tableName;
this.tableRemark = tableRemark;
this.type = type;
this.dataNum = dataNum;
this.center = center;
this.parentId = parentId;
}
public TableInfo(Long id, Long basicId, String tableName, String tableRemark, String type, Long dataNum, String center, Long parentId) {
this.id = id;
this.basicId = basicId;
this.tableName = tableName;
this.tableRemark = tableRemark;
this.type = type;
this.dataNum = dataNum;
this.center = center;
this.parentId = parentId;
}
public TableInfo(String parentName, Long parentId, Integer orderNum, String ancestors, List<?> children, Long id, Long basicId, String tableName, String tableRemark, String type, Long dataNum, String center, Long parentId1) {
super(parentName, parentId, orderNum, ancestors, children);
this.id = id;
this.basicId = basicId;
this.tableName = tableName;
this.tableRemark = tableRemark;
this.type = type;
this.dataNum = dataNum;
this.center = center;
this.parentId = parentId1;
}
/** 表名称/数据库 */
@Excel(name = "表名称/数据库")
private String tableName;

View File

@ -14,10 +14,7 @@ import lombok.experimental.SuperBuilder;
* @Author SaiSai.Liu
* @Date 2024/4/29 14:04
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@SuperBuilder
public class AssetImpowerReq {
private static final long serialVersionUID = 1L;
@ -34,6 +31,65 @@ public class AssetImpowerReq {
@Excel(name = "表id")
private Long tableId;
@Override
public String toString() {
return "AssetImpowerReq{" +
"id=" + id +
", tableId=" + tableId +
", basicId=" + basicId +
", deptId=" + deptId +
", userId=" + userId +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getTableId() {
return tableId;
}
public void setTableId(Long tableId) {
this.tableId = tableId;
}
public Long getBasicId() {
return basicId;
}
public void setBasicId(Long basicId) {
this.basicId = basicId;
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public AssetImpowerReq(Long id, Long tableId, Long basicId, Long deptId, Long userId) {
this.id = id;
this.tableId = tableId;
this.basicId = basicId;
this.deptId = deptId;
this.userId = userId;
}
/**
* id
*/

View File

@ -2,78 +2,213 @@ package com.muyu.domain.req;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
//连接数据源
import java.util.Date;
import java.util.Map;
@Data
@AllArgsConstructor
@NoArgsConstructor
@SuperBuilder
public class SourceReq extends BaseEntity {
/** 主键 */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
*
*
*/
/** 接入源名称 */
@Excel(name = "接入源名称")
private String dataResourceName;
/**
*
*/
/** 数据来源系统名称 */
@Excel(name = "数据来源系统名称")
private String dataSourcesSystemName;
/**
* Ip
*/
/** 主机ip地址 */
@Excel(name = "主机ip地址")
private String host;
/**
*
*/
/** 端口 */
@Excel(name = "端口")
private String port;
/**
*
*/
/** 数据接入类型 */
@Excel(name = "数据接入类型")
private String databaseType;
/**
*
*/
/** 数据库名称 */
@Excel(name = "数据库名称")
private String databaseName;
/**
*
*/
/** 初始化连接数量 */
@Excel(name = "初始化连接数量")
private Long initLinkNum;
/**
*
*/
/** 最大连接数量 */
@Excel(name = "最大连接数量")
private Long maxLinkNum;
/**
*
*/
/** 最大等待时间 */
@Excel(name = "最大等待时间")
private Long maxWaitTime;
/**
*
*/
/** 最大等待次数 */
@Excel(name = "最大等待次数")
private Long maxWaitTimes;
/**
*
*/
private String connectionParams;
@Override
public String toString() {
return "SourceReq{" +
"id=" + id +
", dataResourceName='" + dataResourceName + '\'' +
", dataSourcesSystemName='" + dataSourcesSystemName + '\'' +
", host='" + host + '\'' +
", port='" + port + '\'' +
", databaseType='" + databaseType + '\'' +
", databaseName='" + databaseName + '\'' +
", initLinkNum=" + initLinkNum +
", maxLinkNum=" + maxLinkNum +
", maxWaitTime=" + maxWaitTime +
", maxWaitTimes=" + maxWaitTimes +
'}';
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getDataResourceName() {
return dataResourceName;
}
public void setDataResourceName(String dataResourceName) {
this.dataResourceName = dataResourceName;
}
public String getDataSourcesSystemName() {
return dataSourcesSystemName;
}
public void setDataSourcesSystemName(String dataSourcesSystemName) {
this.dataSourcesSystemName = dataSourcesSystemName;
}
public String getHost() {
return host;
}
public void setHost(String host) {
this.host = host;
}
public String getPort() {
return port;
}
public void setPort(String port) {
this.port = port;
}
public String getDatabaseType() {
return databaseType;
}
public void setDatabaseType(String databaseType) {
this.databaseType = databaseType;
}
public String getDatabaseName() {
return databaseName;
}
public void setDatabaseName(String databaseName) {
this.databaseName = databaseName;
}
public Long getInitLinkNum() {
return initLinkNum;
}
public void setInitLinkNum(Long initLinkNum) {
this.initLinkNum = initLinkNum;
}
public Long getMaxLinkNum() {
return maxLinkNum;
}
public void setMaxLinkNum(Long maxLinkNum) {
this.maxLinkNum = maxLinkNum;
}
public Long getMaxWaitTime() {
return maxWaitTime;
}
public void setMaxWaitTime(Long maxWaitTime) {
this.maxWaitTime = maxWaitTime;
}
public Long getMaxWaitTimes() {
return maxWaitTimes;
}
public void setMaxWaitTimes(Long maxWaitTimes) {
this.maxWaitTimes = maxWaitTimes;
}
public SourceReq(BaseEntityBuilder<?, ?> b, Long id, String dataResourceName, String dataSourcesSystemName, String host, String port, String databaseType, String databaseName, Long initLinkNum, Long maxLinkNum, Long maxWaitTime, Long maxWaitTimes, String connectionParams) {
super(b);
this.id = id;
this.dataResourceName = dataResourceName;
this.dataSourcesSystemName = dataSourcesSystemName;
this.host = host;
this.port = port;
this.databaseType = databaseType;
this.databaseName = databaseName;
this.initLinkNum = initLinkNum;
this.maxLinkNum = maxLinkNum;
this.maxWaitTime = maxWaitTime;
this.maxWaitTimes = maxWaitTimes;
}
public SourceReq(Long id, String dataResourceName, String dataSourcesSystemName, String host, String port, String databaseType, String databaseName, Long initLinkNum, Long maxLinkNum, Long maxWaitTime, Long maxWaitTimes, String connectionParams) {
this.id = id;
this.dataResourceName = dataResourceName;
this.dataSourcesSystemName = dataSourcesSystemName;
this.host = host;
this.port = port;
this.databaseType = databaseType;
this.databaseName = databaseName;
this.initLinkNum = initLinkNum;
this.maxLinkNum = maxLinkNum;
this.maxWaitTime = maxWaitTime;
this.maxWaitTimes = maxWaitTimes;
}
public SourceReq(String searchValue, String createBy, Date createTime, String updateBy, Date updateTime, String remark, Map<String, Object> params, Long id, String dataResourceName, String dataSourcesSystemName, String host, String port, String databaseType, String databaseName, Long initLinkNum, Long maxLinkNum, Long maxWaitTime, Long maxWaitTimes, String connectionParams) {
super(searchValue, createBy, createTime, updateBy, updateTime, remark, params);
this.id = id;
this.dataResourceName = dataResourceName;
this.dataSourcesSystemName = dataSourcesSystemName;
this.host = host;
this.port = port;
this.databaseType = databaseType;
this.databaseName = databaseName;
this.initLinkNum = initLinkNum;
this.maxLinkNum = maxLinkNum;
this.maxWaitTime = maxWaitTime;
this.maxWaitTimes = maxWaitTimes;
}
}

View File

@ -3,18 +3,26 @@
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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.muyu</groupId>
<artifactId>cloud-etl</artifactId>
<version>1.0.0</version>
</parent>
<groupId>com.muyu</groupId>
<artifactId>cloud-etl-server</artifactId>
<version>1.0.0</version>
<dependencies>
<dependency>
<groupId>com.muyu</groupId>
<artifactId>cloud-common-core</artifactId>
</dependency>
<dependency>
<groupId>com.muyu</groupId>
@ -65,11 +73,12 @@
<artifactId>cloud-common-datascope</artifactId>
</dependency>
<!-- MuYu Common Log -->
<!-- <dependency>-->
<!-- <groupId>com.muyu</groupId>-->
<!-- <artifactId>cloud-common-log</artifactId>-->
<!-- </dependency>-->
<dependency>
<groupId>com.muyu</groupId>
<artifactId>cloud-common-log</artifactId>
<version>3.6.3</version>
</dependency>
<!-- 接口模块 -->
<dependency>
@ -77,17 +86,60 @@
<artifactId>cloud-common-api-doc</artifactId>
</dependency>
<!-- &lt;!&ndash; XllJob定时任务 &ndash;&gt;-->
<!-- <dependency>-->
<!-- <groupId>com.muyu</groupId>-->
<!-- <artifactId>cloud-common-xxl</artifactId>-->
<!-- </dependency>-->
<!-- XllJob定时任务 -->
<dependency>
<groupId>com.muyu</groupId>
<artifactId>cloud-common-xxl</artifactId>
<version>3.6.3</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.muyu</groupId>-->
<!-- <artifactId>cloud-common-rabbit</artifactId>-->
<!-- <version>1.0.0</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.baomidou</groupId>-->
<!-- <artifactId>mybatis-plus-boot-starter</artifactId>-->
<!-- <version>3.5.3.1</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>com.baomidou</groupId>-->
<!-- <artifactId>mybatis-plus-core</artifactId>-->
<!-- <version>3.5.3</version> &lt;!&ndash; 请根据实际需要选择版本 &ndash;&gt;-->
<!-- </dependency>-->
</dependencies>
<build>
<finalName>cloud-etl</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- 加入maven deploy插件当在deploy时忽略些model-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -2,13 +2,16 @@ package com.muyu.cloud.etl;
import com.muyu.common.security.annotation.EnableCustomConfig;
import com.muyu.common.security.annotation.EnableMyFeignClients;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableCustomConfig
@EnableMyFeignClients
@SpringBootApplication
@MapperScan("com.muyu.cloud.etl.mapper")
public class MuYuEtlApplication {
public static void main (String[] args) {
SpringApplication.run(MuYuEtlApplication.class, args);

View File

@ -1,33 +0,0 @@
package com.muyu.cloud.etl.controller;
import com.muyu.cloud.etl.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.xml.transform.Result;
/**
* @Authorqdm
* @Packagecom.muyu.cloud.etl.controller
* @Projectcloud-etlsdadawd
* @nameDictionaryController
* @Date2024/8/21 10:34
*/
@RestController
@RequestMapping("/etl")
public class DictionaryController {
@Autowired
private DictionaryService dictionaryService;
@PostMapping("/open/{id}")
public Result open(@PathVariable Long id){
return dictionaryService.open(id);
}
@PostMapping("/close/{id}")
public Result close(@PathVariable Long id){
return dictionaryService.close(id);
}
}

View File

@ -2,15 +2,15 @@ package com.muyu.cloud.etl.controller;
import com.muyu.cloud.etl.service.SourceService;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.poi.ExcelUtil;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.domain.Source;
import com.muyu.domain.req.SourceReq;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -30,4 +30,60 @@ public class SourceController extends BaseController {
return getDataTable(list);
}
/*
*
*/
@RequiresPermissions("etl:info:export")
@PostMapping("/export")
public void export(HttpServletResponse response, SourceReq sourceReq) {
List<Source> list= sourceService.selectSourceList(sourceReq);
ExcelUtil<Source> util = new ExcelUtil<>(Source.class);
util.exportExcel(response,list,"基础信息");
}
/**
*
*/
@RequiresPermissions("etl:info:query")
@GetMapping(value = "/{id}")
public Result getInfo(@PathVariable("id") Long id) {
Source source= sourceService.getInfo(id);
return success(source);
}
/**
*
*/
@RequiresPermissions("etl:info:add")
@PostMapping
public Result add(@RequestBody Source sourceReq) {
return toAjax(sourceService.insertBasicConfigInfo(sourceReq));
}
//批量删除
@RequiresPermissions("etl:info:deleteIds")
@DeleteMapping("{ids}")
public Integer delete(@PathVariable("ids") String ids) {
return sourceService.deleteByIds(ids);
}
/**
*
*/
// @RequiresPermissions("etl:info:updata")
// @PostMapping
// public Result update(@RequestBody Source sourceReq) {
//
// return toAjax(sourceService.updataSource(sourceReq));
// }
}

View File

@ -4,7 +4,6 @@ package com.muyu.cloud.etl.controller;
import com.muyu.cloud.etl.service.SourceTypeService;
import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.controller.BaseController;
import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.domain.SourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -19,8 +18,7 @@ public class SourceTypeController extends BaseController {
@Autowired
private SourceTypeService sourceTypeService;
//查询数据源类型
@RequiresPermissions("etl:type:list")
@GetMapping("/findSourceType")
public Result<List<SourceType>> findSourceType() {
List<SourceType> sourceTypeList=sourceTypeService.findSourceType();

View File

@ -1,20 +0,0 @@
package com.muyu.cloud.etl.mapper;
import feign.Param;
import org.apache.ibatis.annotations.Mapper;
import javax.xml.transform.Result;
/**
* @Authorqdm
* @Packagecom.muyu.cloud.etl.mapper
* @Projectcloud-etlsdadawd
* @nameDictionaryMapper
* @Date2024/8/21 10:39
*/
@Mapper
public interface DictionaryMapper {
Result open(@Param("id") Long id);
Result close(@Param("id") Long id);
}

View File

@ -15,7 +15,7 @@ import java.util.List;
* @Date2024/8/20 20:47
*/
@Mapper
public interface EtlMapper {
public interface EtlMapper{
List<AssetImpower> list(AssetImpower assetImpower);
Result deleteAssetImpowerByIds(@Param("ids") Long[] ids);

View File

@ -1,16 +0,0 @@
package com.muyu.cloud.etl.service;
import javax.xml.transform.Result;
/**
* @Authorqdm
* @Packagecom.muyu.cloud.etl.service
* @Projectcloud-etlsdadawd
* @nameDictionaryService
* @Date2024/8/21 10:35
*/
public interface DictionaryService {
Result open(Long id);
Result close(Long id);
}

View File

@ -8,4 +8,13 @@ import java.util.List;
public interface SourceService extends IService<Source> {
List<Source> selectSourceList(SourceReq sourceReq);
Source getInfo(Long id);
int insertBasicConfigInfo(Source sourceReq);
Integer deleteByIds(String ids);
// int updataSource(Source sourceReq);
}

View File

@ -8,6 +8,4 @@ import java.util.List;
public interface SourceTypeService extends IService<SourceType> {
List<SourceType> findSourceType();
}

View File

@ -1,32 +0,0 @@
package com.muyu.cloud.etl.service.impl;
import com.muyu.cloud.etl.mapper.DictionaryMapper;
import com.muyu.cloud.etl.service.DictionaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.xml.transform.Result;
import java.util.List;
/**
* @Authorqdm
* @Packagecom.muyu.cloud.etl.service.impl
* @Projectcloud-etlsdadawd
* @nameDictionaryServiceImpl
* @Date2024/8/21 10:35
*/
@Service
public class DictionaryServiceImpl implements DictionaryService {
@Autowired
private DictionaryMapper dictionaryMapper;
@Override
public Result open(Long id) {
return dictionaryMapper.open(id);
}
@Override
public Result close(Long id) {
return dictionaryMapper.close(id);
}
}

View File

@ -1,5 +1,6 @@
package com.muyu.cloud.etl.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.cloud.etl.mapper.SourceMapper;
import com.muyu.cloud.etl.service.SourceService;
@ -19,4 +20,34 @@ public class SourceServiceImpl extends ServiceImpl<SourceMapper, Source> impleme
public List<Source> selectSourceList(SourceReq sourceReq) {
return sourceMapper.selectSourceList(sourceReq);
}
@Override
public Source getInfo(Long id) {
LambdaQueryWrapper<Source> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(Source::getId, id);
return this.sourceMapper.selectOne(lambdaQueryWrapper);
}
//新增
@Override
public int insertBasicConfigInfo(Source sourceReq) {
int insert = sourceMapper.insert(sourceReq);
return insert;
}
@Override
public Integer deleteByIds(String ids) {
LambdaQueryWrapper<Source> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.in(Source::getId, ids);
int delete = sourceMapper.delete(lambdaQueryWrapper);
return delete;
}
// @Override
// public int updataSource(Source sourceReq) {
// LambdaQueryWrapper<Source> lambdaQueryWrapper = new LambdaQueryWrapper<>();
// int update = sourceMapper.update(lambdaQueryWrapper);
// return update;
// }
}

View File

@ -10,6 +10,7 @@ nacos:
namespace: text
# Spring
spring:
application:
# 应用名称
name: cloud-etl
@ -45,3 +46,16 @@ spring:
# 系统环境Config共享配置
- application-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
- application-xxl-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
# rabbit 配置文件
- application-rabbit-config-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # 配置 MyBatis 的日志输出实现类,这里是输出到控制台
mapper-locations: classpath:/mapper/*.xml # MyBatis Mapper 文件的位置,这里假设是 XML 形式的 Mapper
global-config:
db-config:
id-type: auto # 主键生成策略,这里设置为自动增长
logic-delete-value: 1 # 逻辑删除标记值,例如设置为 1 表示已删除
logic-not-delete-value: 0 # 逻辑未删除标记值,例如设置为 0 表示未删除
banner: false # 关闭控制台打印的 MyBatis-Plus Banner

View File

@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.cloud.etl.mapper.DictionaryMapper">
<update id="open">
update dictionary set status = 1 where id = #{id}
</update>
<update id="close">
update dictionary set status = 2 where id = #{id}
</update>
</mapper>

View File

@ -4,7 +4,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.muyu.cloud.etl.mapper.EtlMapper">
<sql id="selectAssetDataDictVo">
select id, basic_id, dict_name, dict_type, remark, create_by, create_time, update_by, update_time from asset_data_dict
select id, basic_id, dict_name, dict_type, remark, create_by, create_time, update_by, update_time from asset_data_dict
</sql>
<sql id="list">
select id, basic_id, dict_name, dict_type, remark, create_by, create_time, update_by, update_time from asset_data_dict