数据源模版
parent
747aa9ddf9
commit
ad22e6e234
|
@ -0,0 +1,108 @@
|
|||
package com.etl.data.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.etl.common.core.web.domain.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName DataSource
|
||||
* @Description 描述
|
||||
* @Author YunFei.Du
|
||||
* @Date 2024/4/20 11:36
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("data_source")
|
||||
public class DataSource extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 数据源id
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 数据源名称
|
||||
*/
|
||||
private String dataSourceName;
|
||||
|
||||
/**
|
||||
* 数据库连接地址
|
||||
*/
|
||||
private String linkAddress;
|
||||
|
||||
/**
|
||||
* 主机iq
|
||||
*/
|
||||
private String port;
|
||||
/**
|
||||
* 端口
|
||||
*/
|
||||
private String sql;
|
||||
|
||||
|
||||
/**
|
||||
* 数据库名称
|
||||
*/
|
||||
private String databaseName;
|
||||
|
||||
/**
|
||||
* 用户名
|
||||
*/
|
||||
private String username;
|
||||
|
||||
/**
|
||||
* 密码
|
||||
*/
|
||||
private String password;
|
||||
|
||||
/**
|
||||
* 数据表名称
|
||||
*/
|
||||
private String tableName;
|
||||
|
||||
/** 数据连接参数 */
|
||||
private String connectionParam;
|
||||
|
||||
/** 初始连接数量 */
|
||||
private Long initNum;
|
||||
|
||||
/** 最大连接数量 */
|
||||
private Long maxNum;
|
||||
/**
|
||||
* 连接池数量
|
||||
*/
|
||||
private Long count;
|
||||
|
||||
|
||||
/** 最大等待时间 */
|
||||
private Long maxWaitTime;
|
||||
|
||||
/** 最大等待次数 */
|
||||
private Long maxWaitSize;
|
||||
|
||||
/**
|
||||
* 数据源类型
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/** 数据来源名称 */
|
||||
private String systemName;
|
||||
|
||||
/** 连接驱动名称 */
|
||||
private String jdbcDriver;
|
||||
|
||||
/** 模式名称 */
|
||||
private String modeName;
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.etl.data.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @ClassName DataSourceResp
|
||||
* @Description 描述
|
||||
* @Author YunFei.Du
|
||||
* @Date 2024/4/20 11:42
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DataSourceResp {
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.etl.data;
|
||||
|
||||
import com.etl.common.security.annotation.EnableCustomConfig;
|
||||
import com.etl.common.security.annotation.EnableMyFeignClients;
|
||||
import com.etl.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* 数据源模块
|
||||
*
|
||||
* @author YunFei
|
||||
*/
|
||||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableMyFeignClients
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.etl.data.mapper")
|
||||
public class ETLDataSourceApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(ETLDataSourceApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.etl.data.controller;
|
||||
|
||||
import com.etl.common.core.web.controller.BaseController;
|
||||
import com.etl.data.service.DataSourceService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* 数据源
|
||||
* @author YunFei.Du
|
||||
* @date 21:47 2024/4/25
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/source")
|
||||
public class DataSourceController extends BaseController {
|
||||
@Autowired
|
||||
private DataSourceService dataSourceService;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.etl.data.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.etl.data.domain.DataSource;
|
||||
|
||||
/**
|
||||
* @ClassName DataSourceMapper
|
||||
* @Description 描述
|
||||
* @Author YunFei.Du
|
||||
* @Date 2024/4/20 11:46
|
||||
*/
|
||||
public interface DataSourceMapper extends BaseMapper<DataSource> {
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.etl.data.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.etl.data.domain.DataSource;
|
||||
|
||||
/**
|
||||
* @ClassName DataMansgerService
|
||||
* @Description 描述
|
||||
* @Author YunFei.Du
|
||||
* @Date 2024/4/20 11:48
|
||||
*/
|
||||
public interface DataSourceService extends IService<DataSource> {
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.etl.data.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.etl.data.domain.DataSource;
|
||||
import com.etl.data.mapper.DataSourceMapper;
|
||||
import com.etl.data.service.DataSourceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* @ClassName DataSourceServiceImpl
|
||||
* @Description 描述
|
||||
* @Author YunFei.Du
|
||||
* @Date 2024/4/20 11:49
|
||||
*/
|
||||
@Service
|
||||
public class DataSourceServiceImpl extends ServiceImpl<DataSourceMapper, DataSource> implements DataSourceService {
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
<?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.etl.data.mapper.DataSourceMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue