fix():初始化cloud-etl-common
commit
292ff9c46e
|
@ -0,0 +1,117 @@
|
||||||
|
package com.muyu.etl.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import com.muyu.etl.domain.req.DataSourceAddReq;
|
||||||
|
import com.muyu.etl.domain.req.DataSourceUpdReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0
|
||||||
|
* @Author xie ya ru
|
||||||
|
* @Date 2024/8/19 19:04
|
||||||
|
* @注释
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "order_pay_customer",autoResultMap = true)
|
||||||
|
public class DataSource extends BaseEntity {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private Long dataSourceId;
|
||||||
|
/**
|
||||||
|
*数据源类型 mysql
|
||||||
|
*/
|
||||||
|
private String databaseType;
|
||||||
|
/**
|
||||||
|
*数据源名称 127.0.0.1
|
||||||
|
*/
|
||||||
|
private String databaseFormName;
|
||||||
|
/**
|
||||||
|
*数据来源地址 jdbc:mysql://localhost:3306/dbname?useUnicode=true&serverTimezone=Asia/Shanghai
|
||||||
|
*/
|
||||||
|
private String databaseUrl;
|
||||||
|
/**
|
||||||
|
*来源地址端口号 3306
|
||||||
|
*/
|
||||||
|
private String databasePost;
|
||||||
|
/**
|
||||||
|
*数据库名称 cloud-server
|
||||||
|
*/
|
||||||
|
private String databaseName;
|
||||||
|
/**
|
||||||
|
* 表名称
|
||||||
|
*/
|
||||||
|
private String tableName;
|
||||||
|
/**
|
||||||
|
*数据库登录名 root
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
*数据库登录密码 123
|
||||||
|
*/
|
||||||
|
private String userPwd;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*数据源状态(1启用,2禁用)
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public static DataSource addBuild(DataSourceAddReq req){
|
||||||
|
return DataSource.builder()
|
||||||
|
.databaseFormName(req.getDatabaseFormName())
|
||||||
|
.databaseType(req.getDatabaseType())
|
||||||
|
.databaseUrl(req.getDatabaseUrl())
|
||||||
|
.databasePost(req.getDatabasePost())
|
||||||
|
.databaseName(req.getDatabaseName())
|
||||||
|
.userName(req.getUserName())
|
||||||
|
.userPwd(req.getUserPwd())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static DataSource updBuild(Long dataSourceId, DataSourceUpdReq req){
|
||||||
|
return DataSource.builder()
|
||||||
|
.dataSourceId(dataSourceId)
|
||||||
|
.databaseFormName(req.getDatabaseFormName())
|
||||||
|
.databaseType(req.getDatabaseType())
|
||||||
|
.databaseUrl(req.getDatabaseUrl())
|
||||||
|
.databasePost(req.getDatabasePost())
|
||||||
|
.databaseName(req.getDatabaseName())
|
||||||
|
.userName(req.getUserName())
|
||||||
|
.userPwd(req.getUserPwd())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,70 @@
|
||||||
|
package com.muyu.etl.domain;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0
|
||||||
|
* @Author xie ya ru
|
||||||
|
* @Date 2024/8/22 17:03
|
||||||
|
* @注释
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class EtlData {
|
||||||
|
/**
|
||||||
|
* 字段名称 cloud_id
|
||||||
|
*/
|
||||||
|
private String columnName;
|
||||||
|
/**
|
||||||
|
* 字段值 1
|
||||||
|
*/
|
||||||
|
private String columnValue;
|
||||||
|
/**
|
||||||
|
* 字段类型 Long
|
||||||
|
*/
|
||||||
|
private String columnType;
|
||||||
|
/**
|
||||||
|
* 字段默认长度 19
|
||||||
|
*/
|
||||||
|
private Integer columnSize;
|
||||||
|
/**
|
||||||
|
* 字段是否为空 ture false
|
||||||
|
*/
|
||||||
|
private Boolean isNullable;
|
||||||
|
/**
|
||||||
|
* 字段默认值 1
|
||||||
|
*/
|
||||||
|
private String defaultValue;
|
||||||
|
/**
|
||||||
|
* 字段描述 主键
|
||||||
|
*/
|
||||||
|
private String remarks;
|
||||||
|
/**
|
||||||
|
* 小数位数 2
|
||||||
|
*/
|
||||||
|
private Integer decimalDigits;
|
||||||
|
/**
|
||||||
|
* 行号
|
||||||
|
*/
|
||||||
|
private String row;
|
||||||
|
|
||||||
|
public static EtlData setEtlData(String columnName,String columnValue,String columnType,Integer columnSize,Boolean isNullable,String defaultValue,String remarks,Integer decimalDigits,String row) {
|
||||||
|
return EtlData.builder()
|
||||||
|
.columnName(columnName)
|
||||||
|
.columnValue(columnValue)
|
||||||
|
.columnType(columnType)
|
||||||
|
.columnSize(columnSize)
|
||||||
|
.isNullable(isNullable)
|
||||||
|
.defaultValue(defaultValue)
|
||||||
|
.remarks(remarks)
|
||||||
|
.decimalDigits(decimalDigits)
|
||||||
|
.row(row)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.muyu.etl.domain.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0
|
||||||
|
* @Author xie ya ru
|
||||||
|
* @Date 2024/8/19 19:14
|
||||||
|
* @注释
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "添加数据源信息" ,description = "数据源详细信息的添加")
|
||||||
|
public class DataSourceAddReq {
|
||||||
|
/**
|
||||||
|
* 数据源类型
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "数据来源不可为空")
|
||||||
|
@Schema(type = "String",defaultValue = "MySQL",description = "数据信息来源的信息名称",requiredProperties = "true")
|
||||||
|
private String databaseType;
|
||||||
|
/**
|
||||||
|
* 数据源名称
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "数据源名称不可为空")
|
||||||
|
@Schema(type = "String",defaultValue = "cloud-app",description = "数据源的来源的名称",requiredProperties = "true")
|
||||||
|
private String databaseFormName;
|
||||||
|
/**
|
||||||
|
* 数据来源地址
|
||||||
|
*/
|
||||||
|
@NotEmpty(message = "数据来源地址不可为空")
|
||||||
|
@Schema(type = "String",defaultValue = "127.0.0.1",description = "数据来源地址",requiredProperties = "true")
|
||||||
|
private String databaseUrl;
|
||||||
|
/**
|
||||||
|
* 来源地址端口号
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "3306",description = "来源地址端口号")
|
||||||
|
private String databasePost;
|
||||||
|
/**
|
||||||
|
* 数据库名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "cloud-server",description = "数据库名称")
|
||||||
|
private String databaseName;
|
||||||
|
/**
|
||||||
|
* 表名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "t_student",description = "表名称")
|
||||||
|
private String tableName;
|
||||||
|
/**
|
||||||
|
* 数据库登录名
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "root",description = "数据库登录名")
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 数据库登录密码
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "wuzuxiaoniu@123.",description = "数据库登录密码")
|
||||||
|
private String userPwd;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.muyu.etl.domain.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0
|
||||||
|
* @Author xie ya ru
|
||||||
|
* @Date 2024/8/19 19:14
|
||||||
|
* @注释
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "添加数据源信息" ,description = "数据源详细信息的添加")
|
||||||
|
public class DataSourceReq {
|
||||||
|
/**
|
||||||
|
* 数据源类型
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "MySQL",description = "数据信息来源的信息名称")
|
||||||
|
private String databaseType;
|
||||||
|
/**
|
||||||
|
* 数据源名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "cloud-app",description = "数据源的来源的名称")
|
||||||
|
private String databaseFormName;
|
||||||
|
/**
|
||||||
|
* 数据库名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "cloud-server",description = "数据库名称")
|
||||||
|
private String databaseName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 表名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "t_student",description = "表名称")
|
||||||
|
private String tableName;
|
||||||
|
/**
|
||||||
|
*数据源状态(1启用,2禁用)
|
||||||
|
*/
|
||||||
|
@Schema(type = "Integer",defaultValue = "1",description = "数据源状态(1启用,2禁用)")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.muyu.etl.domain.req;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0
|
||||||
|
* @Author xie ya ru
|
||||||
|
* @Date 2024/8/19 19:14
|
||||||
|
* @注释
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "修改数据源信息" ,description = "数据源详细信息的部分修改")
|
||||||
|
public class DataSourceUpdReq {
|
||||||
|
/**
|
||||||
|
* 数据源类型
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "MySQL",description = "数据信息来源的信息名称")
|
||||||
|
private String databaseType;
|
||||||
|
/**
|
||||||
|
* 数据源名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "cloud-app",description = "数据源的来源的名称")
|
||||||
|
private String databaseFormName;
|
||||||
|
/**
|
||||||
|
* 数据来源地址
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "127.0.0.1",description = "数据来源地址")
|
||||||
|
private String databaseUrl;
|
||||||
|
/**
|
||||||
|
* 来源地址端口号
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "3306",description = "来源地址端口号")
|
||||||
|
private String databasePost;
|
||||||
|
/**
|
||||||
|
* 数据库名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "cloud-server",description = "数据库名称")
|
||||||
|
private String databaseName;
|
||||||
|
/**
|
||||||
|
* 表名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "t_student",description = "表名称")
|
||||||
|
private String tableName;
|
||||||
|
/**
|
||||||
|
* 数据库登录名
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "root",description = "数据库登录名")
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 数据库登录密码
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "wuzuxiaoniu@123.",description = "数据库登录密码")
|
||||||
|
private String userPwd;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,120 @@
|
||||||
|
package com.muyu.etl.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.etl.domain.DataSource;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @version 1.0
|
||||||
|
* @Author xie ya ru
|
||||||
|
* @Date 2024/8/19 19:12
|
||||||
|
* @注释
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
@Tag(name = "数据源输出信息",description = "查询数据源信息需要输出的字段")
|
||||||
|
public class DataSourceResp {
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "1",description = "数据源主键")
|
||||||
|
private Long dataSourceId; /**
|
||||||
|
* 数据源类型
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "MySQL",description = "数据信息来源的信息名称")
|
||||||
|
private String databaseType;
|
||||||
|
/**
|
||||||
|
* 数据源名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "cloud-app",description = "数据源的来源的名称")
|
||||||
|
private String databaseFormName;
|
||||||
|
/**
|
||||||
|
* 数据来源地址
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "127.0.0.1",description = "数据来源地址")
|
||||||
|
private String databaseUrl;
|
||||||
|
/**
|
||||||
|
* 来源地址端口号
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "3306",description = "来源地址端口号")
|
||||||
|
private String databasePost;
|
||||||
|
/**
|
||||||
|
* 数据库名称
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "cloud-server",description = "数据库名称")
|
||||||
|
private String databaseName;
|
||||||
|
/**
|
||||||
|
* 数据库登录名
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "root",description = "数据库登录名")
|
||||||
|
private String userName;
|
||||||
|
/**
|
||||||
|
* 数据库登录密码
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "wuzuxiaoniu@123.",description = "数据库登录密码")
|
||||||
|
private String userPwd;
|
||||||
|
/**
|
||||||
|
* 数据源状态(1启用,2禁用)
|
||||||
|
*/
|
||||||
|
@Schema(type = "String",defaultValue = "1",description = "数据源状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
public static DataSourceResp dataSourceRespBuild(DataSource dataSource){
|
||||||
|
return DataSourceResp.builder()
|
||||||
|
.dataSourceId(dataSource.getDataSourceId())
|
||||||
|
.databaseName(dataSource.getDatabaseName())
|
||||||
|
.databaseType(dataSource.getDatabaseType())
|
||||||
|
.databaseFormName(dataSource.getDatabaseFormName())
|
||||||
|
.databaseUrl(dataSource.getDatabaseUrl())
|
||||||
|
.databasePost(dataSource.getDatabasePost())
|
||||||
|
.databaseName(dataSource.getDatabaseName())
|
||||||
|
.userName(dataSource.getUserName())
|
||||||
|
.userPwd(dataSource.getUserPwd())
|
||||||
|
.status(dataSource.getStatus())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue