数据源类型
parent
059bf421f0
commit
ab4f1e7dea
|
@ -227,9 +227,5 @@ public class SourceReq extends BaseEntity {
|
||||||
* 最多连接数量
|
* 最多连接数量
|
||||||
*/
|
*/
|
||||||
private Long maxWaitTimes;
|
private Long maxWaitTimes;
|
||||||
/**
|
|
||||||
* 连接参数
|
|
||||||
*/
|
|
||||||
private String connectionParams;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,15 @@
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
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">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>cloud-etl</artifactId>
|
<artifactId>cloud-etl</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
|
||||||
<artifactId>cloud-etl-server</artifactId>
|
<artifactId>cloud-etl-server</artifactId>
|
||||||
<version>1.0.0</version>
|
<version>1.0.0</version>
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
|
|
@ -2,15 +2,15 @@ package com.muyu.cloud.etl.controller;
|
||||||
|
|
||||||
import com.muyu.cloud.etl.service.SourceService;
|
import com.muyu.cloud.etl.service.SourceService;
|
||||||
import com.muyu.common.core.domain.Result;
|
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.controller.BaseController;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.domain.Source;
|
import com.muyu.domain.Source;
|
||||||
import com.muyu.domain.req.SourceReq;
|
import com.muyu.domain.req.SourceReq;
|
||||||
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ public class SourceController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SourceService sourceService;
|
private SourceService sourceService;
|
||||||
|
|
||||||
|
|
||||||
//列表
|
//列表
|
||||||
@RequiresPermissions("etl:info:list")
|
@RequiresPermissions("etl:info:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
|
@ -30,4 +31,41 @@ public class SourceController extends BaseController {
|
||||||
return getDataTable(list);
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ package com.muyu.cloud.etl.controller;
|
||||||
import com.muyu.cloud.etl.service.SourceTypeService;
|
import com.muyu.cloud.etl.service.SourceTypeService;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
|
||||||
import com.muyu.domain.SourceType;
|
import com.muyu.domain.SourceType;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
@ -19,8 +18,7 @@ public class SourceTypeController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private SourceTypeService sourceTypeService;
|
private SourceTypeService sourceTypeService;
|
||||||
|
|
||||||
//查询数据源类型
|
|
||||||
@RequiresPermissions("etl:type:list")
|
|
||||||
@GetMapping("/findSourceType")
|
@GetMapping("/findSourceType")
|
||||||
public Result<List<SourceType>> findSourceType() {
|
public Result<List<SourceType>> findSourceType() {
|
||||||
List<SourceType> sourceTypeList=sourceTypeService.findSourceType();
|
List<SourceType> sourceTypeList=sourceTypeService.findSourceType();
|
||||||
|
|
|
@ -8,4 +8,9 @@ import java.util.List;
|
||||||
|
|
||||||
public interface SourceService extends IService<Source> {
|
public interface SourceService extends IService<Source> {
|
||||||
List<Source> selectSourceList(SourceReq sourceReq);
|
List<Source> selectSourceList(SourceReq sourceReq);
|
||||||
|
|
||||||
|
Source getInfo(Long id);
|
||||||
|
|
||||||
|
int insertBasicConfigInfo(Source sourceReq);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.cloud.etl.service.impl;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.cloud.etl.mapper.SourceMapper;
|
import com.muyu.cloud.etl.mapper.SourceMapper;
|
||||||
import com.muyu.cloud.etl.service.SourceService;
|
import com.muyu.cloud.etl.service.SourceService;
|
||||||
|
@ -19,4 +20,18 @@ public class SourceServiceImpl extends ServiceImpl<SourceMapper, Source> impleme
|
||||||
public List<Source> selectSourceList(SourceReq sourceReq) {
|
public List<Source> selectSourceList(SourceReq sourceReq) {
|
||||||
return sourceMapper.selectSourceList(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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue