Commit 7fa12f91 by ljb

独立数据汇聚模块

parent 71ea4320
......@@ -16,6 +16,9 @@ model.name: MODEL-SERVER
data.port: 9688
data.name: DATAOPERATION-SERVER
datacollect.port: 9687
datacollect.name: DATA-COLLECT-SERVER
redis.url: 127.0.0.1
redis.port: 6379
redis.password:
......
......@@ -16,6 +16,9 @@ model.name: MODEL-SERVER
data.port: 9688
data.name: DATAOPERATION-SERVER
datacollect.port: 9697
datacollect.name: DATA-COLLECT-SERVER
redis.url: 127.0.0.1
redis.port: 6379
redis.password:
......
......@@ -13,6 +13,9 @@ spiderflow.name: SPIDER-FLOW
model.port: 9877
model.name: MODEL-SERVER
datacollect.port: 9697
datacollect.name: DATA-COLLECT-SERVER
redis.url: 127.0.0.1
redis.port: 6379
redis.password:
......
package com.zq.datacollect;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@MapperScan({"com.zq.datacollect.mapper"})
@SpringBootApplication
public class DataCollectAppliction {
public static void main(String[] args) {
SpringApplication.run(DataCollectAppliction.class, args);
}
}
\ No newline at end of file
package com.zq.dataoperation.controller;
package com.zq.datacollect.controller;
import cn.hutool.core.util.StrUtil;
import com.zq.common.utils.AssertUtils;
import com.zq.common.vo.ResultVo;
import com.zq.dataoperation.entity.DataCollectSetting;
import com.zq.dataoperation.service.DataCollectService;
import com.zq.dataoperation.vo.DataCollectReq;
import com.zq.dataoperation.vo.DataCollectSettingAddReq;
import com.zq.datacollect.service.DataCollectService;
import com.zq.datacollect.vo.DataCollectReq;
import com.zq.datacollect.vo.DataCollectSettingAddReq;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.List;
@Api(tags = "数据汇聚")
@RequiredArgsConstructor
@RestController
@RequestMapping(value = "/data/collect")
public class DataCollectController {
......@@ -66,4 +64,10 @@ public class DataCollectController {
dataCollectService.batchDelete(ids);
return ResultVo.success("操作成功");
}
@ApiOperation("解析Excel文件")
@PostMapping(value = "/analysis/excel")
public ResultVo analysisExcel(MultipartFile file) throws IOException {
return ResultVo.success(dataCollectService.analysisExcel(file));
}
}
\ No newline at end of file
package com.zq.dataoperation.controller;
package com.zq.datacollect.controller;
import com.zq.common.utils.AssertUtils;
import com.zq.common.vo.ResultVo;
import com.zq.dataoperation.vo.DataCollectLogReq;
import com.zq.datacollect.service.DataCollectLogService;
import com.zq.datacollect.vo.DataCollectLogReq;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import com.zq.dataoperation.service.DataCollectLogService;
import javax.annotation.Resource;
import java.util.List;
......
package com.zq.dataoperation.entity;
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......
package com.zq.dataoperation.entity;
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......
package com.zq.dataoperation.entity;
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......
package com.zq.dataoperation.entity;
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......
package com.zq.dataoperation.entity;
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......
package com.zq.dataoperation.entity;
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
......
package com.zq.dataoperation.entity;
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
......
package com.zq.datacollect.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "query_db")
public class QueryDb {
/**
* id
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
* 数据库名称
*/
private String dbName;
/**
* 数据库ip
*/
private String dbIp;
/**
* 数据库端口
*/
private Integer dbPort;
/**
* 数据库用户名
*/
private String username;
/**
* 数据库密码
*/
private String password;
/**
* 数据库类型(1.Mysql 2.oracle 3.MSSQL )
*/
private Integer dbType;
/**
* createTime
*/
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* updateTime
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
}
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.DataCollectFileLog;
public interface DataCollectFileLogMapper extends BaseMapper<DataCollectFileLog> {
}
\ No newline at end of file
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.DataCollectSetting;
public interface DataCollectMapper extends BaseMapper<DataCollectSetting> {
}
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.DataCollectSettingApi;
public interface DataCollectSettingApiMapper extends BaseMapper<DataCollectSettingApi> {
}
\ No newline at end of file
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.DataCollectSettingApiPara;
public interface DataCollectSettingApiParaMapper extends BaseMapper<DataCollectSettingApiPara> {
}
\ No newline at end of file
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.DataCollectSettingDb;
public interface DataCollectSettingDbMapper extends BaseMapper<DataCollectSettingDb> {
}
\ No newline at end of file
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.DataCollectSettingFile;
public interface DataCollectSettingFileMapper extends BaseMapper<DataCollectSettingFile> {
}
\ No newline at end of file
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.DataCollectSettingSite;
public interface DataCollectSettingSiteMapper extends BaseMapper<DataCollectSettingSite> {
}
\ No newline at end of file
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.DataCollectTaskLog;
public interface DataCollectTaskLogMapper extends BaseMapper<DataCollectTaskLog> {
}
package com.zq.datacollect.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.datacollect.entity.QueryDb;
public interface QueryDbMapper extends BaseMapper<QueryDb> {
}
\ No newline at end of file
package com.zq.datacollect.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zq.common.vo.PageVo;
import com.zq.datacollect.entity.DataCollectFileLog;
import com.zq.datacollect.entity.DataCollectTaskLog;
import com.zq.datacollect.vo.DataCollectLogReq;
import java.util.List;
public interface DataCollectLogService {
PageVo getList(DataCollectLogReq req);
List<DataCollectFileLog> file(Integer id);
boolean removeById(Integer id);
boolean removeByIds(List<Integer> ids);
}
package com.zq.datacollect.service;
import com.zq.common.vo.PageVo;
import com.zq.datacollect.entity.DataCollectSetting;
import com.zq.datacollect.vo.DataCollectReq;
import com.zq.datacollect.vo.DataCollectSettingAddReq;
import com.zq.datacollect.vo.DataCollectSettingResp;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List;
import java.util.Map;
public interface DataCollectService {
PageVo<DataCollectSetting> getList(DataCollectReq req);
DataCollectSettingResp get(Integer id);
void add(DataCollectSettingAddReq dataCollectSettingAddReq);
void update(DataCollectSettingAddReq dataCollectSettingAddReq);
void delete(Integer id);
void batchDelete(List<Integer> ids);
List<Map<String, Object>> analysisExcel(MultipartFile multipartFile) throws IOException;
}
package com.zq.dataoperation.service;
package com.zq.datacollect.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zq.common.utils.PagingUtils;
import com.zq.common.vo.PageVo;
import com.zq.dataoperation.dao.DataCollectFileLogDao;
import com.zq.dataoperation.dao.DataCollectTaskLogDao;
import com.zq.dataoperation.entity.DataCollectSetting;
import com.zq.dataoperation.entity.DataCollectFileLog;
import com.zq.dataoperation.entity.DataCollectTaskLog;
import com.zq.dataoperation.vo.DataCollectLogReq;
import com.zq.dataoperation.vo.DataCollectTaskLogResp;
import com.zq.datacollect.entity.DataCollectFileLog;
import com.zq.datacollect.entity.DataCollectSetting;
import com.zq.datacollect.entity.DataCollectTaskLog;
import com.zq.datacollect.mapper.DataCollectFileLogMapper;
import com.zq.datacollect.mapper.DataCollectTaskLogMapper;
import com.zq.datacollect.service.DataCollectLogService;
import com.zq.datacollect.vo.DataCollectLogReq;
import com.zq.datacollect.vo.DataCollectTaskLogResp;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
@Service
public class DataCollectLogService extends ServiceImpl<DataCollectTaskLogDao, DataCollectTaskLog> {
public class DataCollectLogServiceImpl extends ServiceImpl<DataCollectTaskLogMapper, DataCollectTaskLog> implements DataCollectLogService {
@Resource
DataCollectTaskLogDao dataCollectTaskLogDao;
DataCollectTaskLogMapper dataCollectTaskLogMapper;
@Resource
private DataCollectService dataCollectService;
private DataCollectServiceImpl dataCollectServiceImpl;
@Resource
private DataCollectFileLogDao dataCollectFileLogDao;
private DataCollectFileLogMapper dataCollectFileLogMapper;
@Override
public PageVo getList(DataCollectLogReq req) {
LambdaQueryWrapper<DataCollectTaskLog> wrapper = new LambdaQueryWrapper<>();
PageVo pageVo = PagingUtils.paging(req, dataCollectTaskLogDao, wrapper,DataCollectTaskLog.class);
PageVo pageVo = PagingUtils.paging(req, dataCollectTaskLogMapper, wrapper,DataCollectTaskLog.class);
List<DataCollectTaskLogResp> taskLogRespList = new ArrayList<>(pageVo.getRows().size());
for (Object row : pageVo.getRows()) {
DataCollectTaskLog dataCollectTaskLog = (DataCollectTaskLog) row;
DataCollectSetting dataCollectSetting = dataCollectService.getById(dataCollectTaskLog.getDataCollectSettingId());
DataCollectSetting dataCollectSetting = dataCollectServiceImpl.getById(dataCollectTaskLog.getDataCollectSettingId());
if(null == dataCollectSetting){
continue;
}
......@@ -50,7 +51,18 @@ public class DataCollectLogService extends ServiceImpl<DataCollectTaskLogDao, Da
return pageVo;
}
@Override
public List<DataCollectFileLog> file(Integer id){
return dataCollectFileLogDao.selectList(new LambdaQueryWrapper<DataCollectFileLog>().eq(DataCollectFileLog::getDataCollectSettingFileId, id));
return dataCollectFileLogMapper.selectList(new LambdaQueryWrapper<DataCollectFileLog>().eq(DataCollectFileLog::getDataCollectSettingFileId, id));
}
@Override
public boolean removeById(Integer id) {
return super.removeById(id);
}
@Override
public boolean removeByIds(List<Integer> ids) {
return super.removeByIds(ids);
}
}
package com.zq.dataoperation.service;
package com.zq.datacollect.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.io.FileUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
......@@ -10,51 +14,58 @@ import com.zq.common.exception.BusinessException;
import com.zq.common.utils.AssertUtils;
import com.zq.common.utils.PagingUtils;
import com.zq.common.vo.PageVo;
import com.zq.dataoperation.dao.*;
import com.zq.dataoperation.entity.*;
import com.zq.dataoperation.vo.DataCollectReq;
import com.zq.dataoperation.vo.DataCollectSettingAddReq;
import com.zq.dataoperation.vo.DataCollectSettingApiAddReq;
import com.zq.dataoperation.vo.DataCollectSettingResp;
import com.zq.datacollect.entity.DataCollectSetting;
import com.zq.datacollect.entity.DataCollectSettingApi;
import com.zq.datacollect.entity.DataCollectSettingApiPara;
import com.zq.datacollect.entity.QueryDb;
import com.zq.datacollect.mapper.*;
import com.zq.datacollect.service.DataCollectService;
import com.zq.datacollect.vo.DataCollectReq;
import com.zq.datacollect.vo.DataCollectSettingAddReq;
import com.zq.datacollect.vo.DataCollectSettingApiAddReq;
import com.zq.datacollect.vo.DataCollectSettingResp;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.io.IOException;
import java.util.*;
@Slf4j
@Service
@RequiredArgsConstructor
public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectSetting> {
public class DataCollectServiceImpl extends ServiceImpl<DataCollectMapper, DataCollectSetting> implements DataCollectService {
@Resource
private DataCollectDao dataCollectDao;
private DataCollectMapper dataCollectMapper;
@Resource
private DataCollectSettingDbDao dataCollectSettingDbDao;
private DataCollectSettingDbMapper dataCollectSettingDbMapper;
@Resource
private DataCollectSettingFileDao dataCollectSettingFileDao;
private DataCollectSettingFileMapper dataCollectSettingFileMapper;
@Resource
private DataCollectSettingApiDao dataCollectSettingApiDao;
private DataCollectSettingApiMapper dataCollectSettingApiMapper;
@Resource
private DataCollectSettingSiteDao dataCollectSettingSiteDao;
private DataCollectSettingSiteMapper dataCollectSettingSiteMapper;
@Resource
private DataCollectSettingApiParaDao dataCollectSettingApiParaDao;
private DataCollectSettingApiParaMapper dataCollectSettingApiParaMapper;
@Resource
private QueryDbDao queryDbDao;
private QueryDbMapper queryDbMapper;
@Override
public PageVo<DataCollectSetting> getList(DataCollectReq req) {
return PagingUtils.paging(req, dataCollectDao, new LambdaQueryWrapper<>(), DataCollectSetting.class);
return PagingUtils.paging(req, dataCollectMapper, new LambdaQueryWrapper<>(), DataCollectSetting.class);
}
@Override
public DataCollectSettingResp get(Integer id){
DataCollectSetting dataCollectSetting = getById(id);
DataCollectSettingResp resp = new DataCollectSettingResp();
......@@ -65,10 +76,10 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
List list = getDao(dataCollectSetting.getDataType()).selectList(wrapper);
resp.setDataFromSetting(list);
}else {
List<DataCollectSettingApi> apis = dataCollectSettingApiDao.selectList(new LambdaQueryWrapper<DataCollectSettingApi>().eq(DataCollectSettingApi::getDataCollectSettingId, dataCollectSetting.getId()));
List<DataCollectSettingApi> apis = dataCollectSettingApiMapper.selectList(new LambdaQueryWrapper<DataCollectSettingApi>().eq(DataCollectSettingApi::getDataCollectSettingId, dataCollectSetting.getId()));
List<DataCollectSettingApiAddReq> vos = BeanUtil.copyToList(apis, DataCollectSettingApiAddReq.class);
for (DataCollectSettingApiAddReq vo : vos) {
List<DataCollectSettingApiPara> apiParas = dataCollectSettingApiParaDao.selectList(new LambdaQueryWrapper<DataCollectSettingApiPara>().eq(DataCollectSettingApiPara::getDataCollectSettingApiId, vo.getId()));
List<DataCollectSettingApiPara> apiParas = dataCollectSettingApiParaMapper.selectList(new LambdaQueryWrapper<DataCollectSettingApiPara>().eq(DataCollectSettingApiPara::getDataCollectSettingApiId, vo.getId()));
vo.setApiParas(apiParas);
}
resp.setDataFromSetting(vos);
......@@ -76,6 +87,7 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
return resp;
}
@Override
@Transactional
public void add(DataCollectSettingAddReq dataCollectSettingAddReq){
boolean b = save(dataCollectSettingAddReq);
......@@ -84,7 +96,7 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
HashMap<String, Object> map = new HashMap();
BeanUtil.copyProperties(dataCollectSettingAddReq.getDataFromSetting(), map);
if(dataCollectSettingAddReq.getDataType() == 1){
QueryDb db = queryDbDao.selectById((Integer) map.get("databaseId"));
QueryDb db = queryDbMapper.selectById((Integer) map.get("databaseId"));
map.put("dbName", db.getDbName());
map.put("dbIp", db.getDbIp());
map.put("dbPort", db.getDbPort());
......@@ -99,14 +111,15 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
DataCollectSettingApiAddReq apiAddReq = new DataCollectSettingApiAddReq();
BeanUtil.copyProperties(dataCollectSettingAddReq.getDataFromSetting(), apiAddReq);
apiAddReq.setDataCollectSettingId(dataCollectSettingAddReq.getId());
AssertUtils.isTrue(dataCollectSettingApiDao.insert(apiAddReq)==1, "添加失败");
AssertUtils.isTrue(dataCollectSettingApiMapper.insert(apiAddReq)==1, "添加失败");
for (DataCollectSettingApiPara apiPara : apiAddReq.getApiParas()) {
apiPara.setDataCollectSettingApiId(apiAddReq.getId());
AssertUtils.isTrue(dataCollectSettingApiParaDao.insert(apiPara)==1, "添加失败");
AssertUtils.isTrue(dataCollectSettingApiParaMapper.insert(apiPara)==1, "添加失败");
}
}
}
@Override
@Transactional
public void update(DataCollectSettingAddReq dataCollectSettingAddReq){
DataCollectSetting dataCollectSetting = getById(dataCollectSettingAddReq.getId());
......@@ -120,6 +133,7 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
AssertUtils.isTrue(updateById(dataCollectSettingAddReq), "修改失败");
}
@Override
public void delete(Integer id){
DataCollectSetting dataCollectSetting = getById(id);
UpdateWrapper wrapper = new UpdateWrapper();
......@@ -128,6 +142,7 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
AssertUtils.isTrue(removeById(id), "删除失败");
}
@Override
@Transactional
public void batchDelete(List<Integer> ids){
for (Integer id : ids) {
......@@ -135,16 +150,44 @@ public class DataCollectService extends ServiceImpl<DataCollectDao, DataCollectS
}
}
@Override
public List<Map<String, Object>> analysisExcel(MultipartFile file) throws IOException {
String suffix = FileUtil.extName(file.getOriginalFilename());
AssertUtils.isTrue(suffix.equals("xls") || suffix.equals("xlsx") || suffix.equals("et"), "不支持的文件类型");
List<Map<String, Object>> list = new LinkedList<>();
EasyExcel.read(file.getInputStream(), new AnalysisEventListener<Map<Integer, Object>>() {
private Map<Integer, String> headMap;
@Override
public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
this.headMap = headMap;
}
@Override
public void invoke(Map<Integer, Object> valueMap, AnalysisContext analysisContext) {
LinkedHashMap map = new LinkedHashMap(valueMap.size());
for(int i=0; i<valueMap.size(); i++){
map.put(headMap.get(i), valueMap.get(i));
}
list.add(map);
}
@Override
public void doAfterAllAnalysed(AnalysisContext analysisContext) {}
}).sheet().doReadSync();
return list;
}
public BaseMapper getDao(int dataType){
switch (dataType) {
case 1:
return dataCollectSettingDbDao;
return dataCollectSettingDbMapper;
case 2:
return dataCollectSettingFileDao;
return dataCollectSettingFileMapper;
case 3:
return dataCollectSettingApiDao;
return dataCollectSettingApiMapper;
case 4:
return dataCollectSettingSiteDao;
return dataCollectSettingSiteMapper;
default:
throw new BusinessException("不支持的类型");
}
......
package com.zq.dataoperation.vo;
package com.zq.datacollect.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.zq.common.vo.PageReqVo;
import com.zq.common.vo.PageVo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......
package com.zq.dataoperation.vo;
package com.zq.datacollect.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
......
package com.zq.dataoperation.vo;
package com.zq.datacollect.vo;
import com.zq.dataoperation.entity.DataCollectSetting;
import com.zq.datacollect.entity.DataCollectSetting;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......
package com.zq.dataoperation.vo;
package com.zq.datacollect.vo;
import com.zq.dataoperation.entity.DataCollectSettingApi;
import com.zq.dataoperation.entity.DataCollectSettingApiPara;
import com.zq.datacollect.entity.DataCollectSettingApi;
import com.zq.datacollect.entity.DataCollectSettingApiPara;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......
package com.zq.dataoperation.vo;
package com.zq.datacollect.vo;
import com.zq.dataoperation.entity.DataCollectSetting;
import com.zq.datacollect.entity.DataCollectSetting;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......
package com.zq.dataoperation.vo;
package com.zq.datacollect.vo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
......
server:
port: ${datacollect.port}
#配置数据源
spring:
application:
name: ${datacollect.name}
servlet:
#上传文件限制
multipart:
#单个文件大小
max-file-size: 20MB
#设置总上传的数据大小
max-request-size: 50MB
jackson:
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
redis:
#数据库索引
database: 0
host: ${redis.url}
port: ${redis.port}
password: ${redis.password}
#连接超时时间
timeout: 5000
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: ${jdbc.driver-class-name}
username: ${jdbc.username}
password: ${jdbc.password}
url: ${jdbc.url}
# 初始连接数
initial-size: 5
# 最小连接数
min-idle: 10
# 最大连接数
max-active: 20
# 获取连接超时时间
max-wait: 5000
# 连接有效性检测时间
time-between-eviction-runs-millis: 60000
# 连接在池中最小生存的时间
min-evictable-idle-time-millis: 300000
# 连接在池中最大生存的时间
max-evictable-idle-time-millis: 900000
test-while-idle: true
test-on-borrow: false
test-on-return: false
# 检测连接是否有效
validation-query: SELECT 1 FROM DUAL
# 配置监控统计
webStatFilter:
enabled: true
stat-view-servlet:
enabled: true
url-pattern: /druid/*
reset-enable: false
allow: ""
filter:
stat:
enabled: true
# 记录慢SQL
log-slow-sql: true
slow-sql-millis: 1000
merge-sql: true
wall:
config:
multi-statement-allow: true
# mybatis plus 配置
mybatis-plus:
configuration:
jdbc-type-for-null: null
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
global-config:
db-config:
select-strategy: not_empty
update-strategy: not_empty
\ No newline at end of file
spring:
cloud:
config:
name: config
profile: @profiles.active@
discovery:
enabled: true
service-id: CONFIG-SERVER
uri: http://127.0.0.1:8300/
eureka:
instance:
prefer-ip-address: true
lease-renewal-interval-in-seconds: 2 #每间隔1s,向服务端发送一次心跳,证明自己依然"存活"
lease-expiration-duration-in-seconds: 6 #告诉服务端,如果我2s之内没有给你发心跳,就代表我"死"了,将我踢出掉。
instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
client:
service-url:
defaultZone: http://admin:123456@127.0.0.1:8800/eureka/
package com.zq.dataoperation.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.dataoperation.entity.DataCollectSetting;
public interface DataCollectDao extends BaseMapper<DataCollectSetting> {
}
package com.zq.dataoperation.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.dataoperation.entity.DataCollectFileLog;
public interface DataCollectFileLogDao extends BaseMapper<DataCollectFileLog> {
}
\ No newline at end of file
package com.zq.dataoperation.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.dataoperation.entity.DataCollectSettingApi;
public interface DataCollectSettingApiDao extends BaseMapper<DataCollectSettingApi> {
}
\ No newline at end of file
package com.zq.dataoperation.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.dataoperation.entity.DataCollectSettingApiPara;
public interface DataCollectSettingApiParaDao extends BaseMapper<DataCollectSettingApiPara> {
}
\ No newline at end of file
package com.zq.dataoperation.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.dataoperation.entity.DataCollectSettingDb;
import com.zq.dataoperation.entity.QueryDb;
public interface DataCollectSettingDbDao extends BaseMapper<DataCollectSettingDb> {
}
\ No newline at end of file
package com.zq.dataoperation.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.dataoperation.entity.DataCollectSettingFile;
public interface DataCollectSettingFileDao extends BaseMapper<DataCollectSettingFile> {
}
\ No newline at end of file
package com.zq.dataoperation.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.dataoperation.entity.DataCollectSettingSite;
public interface DataCollectSettingSiteDao extends BaseMapper<DataCollectSettingSite> {
}
\ No newline at end of file
package com.zq.dataoperation.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zq.dataoperation.entity.DataCollectTaskLog;
public interface DataCollectTaskLogDao extends BaseMapper<DataCollectTaskLog> {
}
......@@ -42,6 +42,10 @@ spring:
uri: lb://${model.name}
predicates:
- Path=/model/**
- id: datacollect
uri: lb://${datacollect.name}
predicates:
- Path=/data/collect/**
- id: data
uri: lb://${data.name}
predicates:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment