数据源类型

master
lwj 2024-08-21 17:23:53 +08:00
parent 059bf421f0
commit ab4f1e7dea
7 changed files with 66 additions and 10 deletions

View File

@ -227,9 +227,5 @@ public class SourceReq extends BaseEntity {
*
*/
private Long maxWaitTimes;
/**
*
*/
private String connectionParams;
}

View File

@ -3,12 +3,15 @@
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>

View File

@ -7,6 +7,7 @@ import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableCustomConfig
@EnableMyFeignClients
@SpringBootApplication

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;
@ -21,6 +21,7 @@ public class SourceController extends BaseController {
@Autowired
private SourceService sourceService;
//列表
@RequiresPermissions("etl:info:list")
@GetMapping("/list")
@ -30,4 +31,41 @@ 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));
}
}

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

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

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,18 @@ 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;
}
}