数据接入
parent
592dec16cc
commit
6cb9dd439a
|
@ -0,0 +1,173 @@
|
|||
package com.muyu.data.source.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.data.source.domain.req.DataSourceQueryReq;
|
||||
import com.muyu.data.source.domain.req.DataSourceSaveReq;
|
||||
import com.muyu.data.source.domain.req.DataSourceEditReq;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数据源对象 data_source
|
||||
*
|
||||
* @author hufangming
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("data_source")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "DataSource", description = "数据源")
|
||||
public class DataSource extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "编号", value = "编号")
|
||||
private Long id;
|
||||
|
||||
/** 接入源名称 */
|
||||
@Excel(name = "接入源名称")
|
||||
@ApiModelProperty(name = "接入源名称", value = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
@Excel(name = "数据来源系统名称")
|
||||
@ApiModelProperty(name = "数据来源系统名称", value = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据库名称 */
|
||||
@Excel(name = "数据库名称")
|
||||
@ApiModelProperty(name = "数据库名称", value = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据库类型 */
|
||||
@Excel(name = "数据库类型")
|
||||
@ApiModelProperty(name = "数据库类型", value = "数据库类型")
|
||||
private Long databaseType;
|
||||
|
||||
/** 主机地址 */
|
||||
@Excel(name = "主机地址")
|
||||
@ApiModelProperty(name = "主机地址", value = "主机地址")
|
||||
private String host;
|
||||
|
||||
/** 端口号 */
|
||||
@Excel(name = "端口号")
|
||||
@ApiModelProperty(name = "端口号", value = "端口号")
|
||||
private String port;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
@ApiModelProperty(name = "用户名", value = "用户名")
|
||||
private String user;
|
||||
|
||||
/** 密码 */
|
||||
@Excel(name = "密码")
|
||||
@ApiModelProperty(name = "密码", value = "密码")
|
||||
private String password;
|
||||
|
||||
/** 类型 '查询'/'存储' */
|
||||
@Excel(name = "类型 '查询'/'存储'")
|
||||
@ApiModelProperty(name = "类型 '查询'/'存储'", value = "类型 '查询'/'存储'")
|
||||
private String type;
|
||||
|
||||
/** 数据连接参数 */
|
||||
@Excel(name = "数据连接参数")
|
||||
@ApiModelProperty(name = "数据连接参数", value = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 状态 'Y'/'N' */
|
||||
@Excel(name = "状态 'Y'/'N'")
|
||||
@ApiModelProperty(name = "状态 'Y'/'N'", value = "状态 'Y'/'N'")
|
||||
private String status;
|
||||
|
||||
/** 初始连接数量 */
|
||||
@Excel(name = "初始连接数量")
|
||||
@ApiModelProperty(name = "初始连接数量", value = "初始连接数量")
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
@Excel(name = "最大连接数量")
|
||||
@ApiModelProperty(name = "最大连接数量", value = "最大连接数量")
|
||||
private Long maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
@Excel(name = "最大等待时间")
|
||||
@ApiModelProperty(name = "最大等待时间", value = "最大等待时间")
|
||||
private Long maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
@Excel(name = "最大等待次数")
|
||||
@ApiModelProperty(name = "最大等待次数", value = "最大等待次数")
|
||||
private Long maxWaitSize;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static DataSource queryBuild( DataSourceQueryReq dataSourceQueryReq){
|
||||
return DataSource.builder()
|
||||
.name(dataSourceQueryReq.getName())
|
||||
.systemName(dataSourceQueryReq.getSystemName())
|
||||
.databaseName(dataSourceQueryReq.getDatabaseName())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static DataSource saveBuild(DataSourceSaveReq dataSourceSaveReq){
|
||||
return DataSource.builder()
|
||||
.name(dataSourceSaveReq.getName())
|
||||
.systemName(dataSourceSaveReq.getSystemName())
|
||||
.databaseName(dataSourceSaveReq.getDatabaseName())
|
||||
.databaseType(dataSourceSaveReq.getDatabaseType())
|
||||
.host(dataSourceSaveReq.getHost())
|
||||
.port(dataSourceSaveReq.getPort())
|
||||
.user(dataSourceSaveReq.getUser())
|
||||
.password(dataSourceSaveReq.getPassword())
|
||||
.type(dataSourceSaveReq.getType())
|
||||
.connectionParam(dataSourceSaveReq.getConnectionParam())
|
||||
.status(dataSourceSaveReq.getStatus())
|
||||
.initNum(dataSourceSaveReq.getInitNum())
|
||||
.maxNum(dataSourceSaveReq.getMaxNum())
|
||||
.maxWaitTime(dataSourceSaveReq.getMaxWaitTime())
|
||||
.maxWaitSize(dataSourceSaveReq.getMaxWaitSize())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static DataSource editBuild(Long id, DataSourceEditReq dataSourceEditReq){
|
||||
return DataSource.builder()
|
||||
.id(id)
|
||||
.name(dataSourceEditReq.getName())
|
||||
.systemName(dataSourceEditReq.getSystemName())
|
||||
.databaseName(dataSourceEditReq.getDatabaseName())
|
||||
.databaseType(dataSourceEditReq.getDatabaseType())
|
||||
.host(dataSourceEditReq.getHost())
|
||||
.port(dataSourceEditReq.getPort())
|
||||
.user(dataSourceEditReq.getUser())
|
||||
.password(dataSourceEditReq.getPassword())
|
||||
.type(dataSourceEditReq.getType())
|
||||
.connectionParam(dataSourceEditReq.getConnectionParam())
|
||||
.status(dataSourceEditReq.getStatus())
|
||||
.initNum(dataSourceEditReq.getInitNum())
|
||||
.maxNum(dataSourceEditReq.getMaxNum())
|
||||
.maxWaitTime(dataSourceEditReq.getMaxWaitTime())
|
||||
.maxWaitSize(dataSourceEditReq.getMaxWaitSize())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package com.muyu.data.source.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数据源对象 data_source
|
||||
*
|
||||
* @author hufangming
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "DataSourceEditReq", description = "数据源")
|
||||
public class DataSourceEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 接入源名称 */
|
||||
@ApiModelProperty(name = "接入源名称", value = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
@ApiModelProperty(name = "数据来源系统名称", value = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据库名称 */
|
||||
@ApiModelProperty(name = "数据库名称", value = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据库类型 */
|
||||
@ApiModelProperty(name = "数据库类型", value = "数据库类型")
|
||||
private Long databaseType;
|
||||
|
||||
/** 主机地址 */
|
||||
@ApiModelProperty(name = "主机地址", value = "主机地址")
|
||||
private String host;
|
||||
|
||||
/** 端口号 */
|
||||
@ApiModelProperty(name = "端口号", value = "端口号")
|
||||
private String port;
|
||||
|
||||
/** 用户名 */
|
||||
@ApiModelProperty(name = "用户名", value = "用户名")
|
||||
private String user;
|
||||
|
||||
/** 密码 */
|
||||
@ApiModelProperty(name = "密码", value = "密码")
|
||||
private String password;
|
||||
|
||||
/** 类型 '查询'/'存储' */
|
||||
@ApiModelProperty(name = "类型 '查询'/'存储'", value = "类型 '查询'/'存储'")
|
||||
private String type;
|
||||
|
||||
/** 数据连接参数 */
|
||||
@ApiModelProperty(name = "数据连接参数", value = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 状态 'Y'/'N' */
|
||||
@ApiModelProperty(name = "状态 'Y'/'N'", value = "状态 'Y'/'N'")
|
||||
private String status;
|
||||
|
||||
/** 初始连接数量 */
|
||||
@ApiModelProperty(name = "初始连接数量", value = "初始连接数量")
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
@ApiModelProperty(name = "最大连接数量", value = "最大连接数量")
|
||||
private Long maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
@ApiModelProperty(name = "最大等待时间", value = "最大等待时间")
|
||||
private Long maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
@ApiModelProperty(name = "最大等待次数", value = "最大等待次数")
|
||||
private Long maxWaitSize;
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.data.source.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数据源对象 data_source
|
||||
*
|
||||
* @author hufangming
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "DataSourceQueryReq", description = "数据源")
|
||||
public class DataSourceQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 接入源名称 */
|
||||
@ApiModelProperty(name = "接入源名称", value = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
@ApiModelProperty(name = "数据来源系统名称", value = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据库名称 */
|
||||
@ApiModelProperty(name = "数据库名称", value = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package com.muyu.data.source.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数据源对象 data_source
|
||||
*
|
||||
* @author hufangming
|
||||
* @date 2024-04-21
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "DataSourceSaveReq", description = "数据源")
|
||||
public class DataSourceSaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
|
||||
@ApiModelProperty(name = "编号", value = "编号")
|
||||
private Long id;
|
||||
|
||||
/** 接入源名称 */
|
||||
|
||||
@ApiModelProperty(name = "接入源名称", value = "接入源名称")
|
||||
private String name;
|
||||
|
||||
/** 数据来源系统名称 */
|
||||
|
||||
@ApiModelProperty(name = "数据来源系统名称", value = "数据来源系统名称")
|
||||
private String systemName;
|
||||
|
||||
/** 数据库名称 */
|
||||
|
||||
@ApiModelProperty(name = "数据库名称", value = "数据库名称")
|
||||
private String databaseName;
|
||||
|
||||
/** 数据库类型 */
|
||||
|
||||
@ApiModelProperty(name = "数据库类型", value = "数据库类型")
|
||||
private Long databaseType;
|
||||
|
||||
/** 主机地址 */
|
||||
|
||||
@ApiModelProperty(name = "主机地址", value = "主机地址")
|
||||
private String host;
|
||||
|
||||
/** 端口号 */
|
||||
|
||||
@ApiModelProperty(name = "端口号", value = "端口号")
|
||||
private String port;
|
||||
|
||||
/** 用户名 */
|
||||
|
||||
@ApiModelProperty(name = "用户名", value = "用户名")
|
||||
private String user;
|
||||
|
||||
/** 密码 */
|
||||
|
||||
@ApiModelProperty(name = "密码", value = "密码")
|
||||
private String password;
|
||||
|
||||
/** 类型 '查询'/'存储' */
|
||||
|
||||
@ApiModelProperty(name = "类型 '查询'/'存储'", value = "类型 '查询'/'存储'")
|
||||
private String type;
|
||||
|
||||
/** 数据连接参数 */
|
||||
|
||||
@ApiModelProperty(name = "数据连接参数", value = "数据连接参数")
|
||||
private String connectionParam;
|
||||
|
||||
/** 状态 'Y'/'N' */
|
||||
|
||||
@ApiModelProperty(name = "状态 'Y'/'N'", value = "状态 'Y'/'N'")
|
||||
private String status;
|
||||
|
||||
/** 初始连接数量 */
|
||||
|
||||
@ApiModelProperty(name = "初始连接数量", value = "初始连接数量")
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
|
||||
@ApiModelProperty(name = "最大连接数量", value = "最大连接数量")
|
||||
private Long maxNum;
|
||||
|
||||
/** 最大等待时间 */
|
||||
|
||||
@ApiModelProperty(name = "最大等待时间", value = "最大等待时间")
|
||||
private Long maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
|
||||
@ApiModelProperty(name = "最大等待次数", value = "最大等待次数")
|
||||
private Long maxWaitSize;
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.data.source;
|
||||
|
||||
|
||||
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
*
|
||||
* @author muyu
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
public class MuYuDataSourceApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(MuYuDataSourceApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9511
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
main:
|
||||
allow-circular-references: true
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-data-source
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
cloud:
|
||||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 192.168.16.128
|
||||
namespace: ry
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 192.168.16.128
|
||||
namespace: ry
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
logging:
|
||||
level:
|
||||
com.muyu.shop.cart.mapper: DEBUG
|
Loading…
Reference in New Issue