Browse Source

dada_aggregator引入data_statistical数据源

dev_shibei_match
sunyuchao 4 years ago
parent
commit
6cf0f40b6d
  1. 2
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java
  2. 28
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  3. 20
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java
  4. 29
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java
  5. 9
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java
  6. 22
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  7. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
  8. 7
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

2
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java

@ -26,4 +26,6 @@ public interface DataSourceConstant {
String EPMET_COMMON_SERVICE="commonservice";
String OPER_CRM="opercrm";
String DATA_STATISTICAL="datastatistical";
}

28
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -157,6 +157,13 @@
<datasource.druid.opercrm.username>epmet_oper_crm_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- data_statistical -->
<datasource.druid.opercrm.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercrm.url>
<datasource.druid.opercrm.username>epmet_data_statistical_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
@ -238,6 +245,13 @@
<datasource.druid.opercrm.username>epmet_oper_crm_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- data_statistical -->
<datasource.druid.opercrm.url>
<![CDATA[jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercrm.url>
<datasource.druid.opercrm.username>epmet_data_statistical_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.130</spring.redis.host>
@ -319,6 +333,13 @@
<datasource.druid.opercrm.username>epmet</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>elink@833066</datasource.druid.opercrm.password>
<!-- data_statistical -->
<datasource.druid.opercrm.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercrm.url>
<datasource.druid.opercrm.username>epmet_data_statistical_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -400,6 +421,13 @@
<datasource.druid.opercrm.username>epmet_oper_crm_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- data_statistical -->
<datasource.druid.opercrm.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_data_statistical?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.opercrm.url>
<datasource.druid.opercrm.username>epmet_data_statistical_user</datasource.druid.opercrm.username>
<datasource.druid.opercrm.password>EpmEt-db-UsEr</datasource.druid.opercrm.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

20
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java

@ -0,0 +1,20 @@
package com.epmet.dataaggre.controller;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @Author sun
* @Description 数据统计服务
*/
@RestController
@RequestMapping("datastats")
public class DataStatsController {
@Autowired
private DataStatsService dataStatsService;
}

29
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java

@ -0,0 +1,29 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dataaggre.dao.datastats;
import org.apache.ibatis.annotations.Mapper;
/**
* @Author sun
* @Description 数据统计服务
*/
@Mapper
public interface DataStatsDao {
}

9
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java

@ -0,0 +1,9 @@
package com.epmet.dataaggre.service.datastats;
/**
* @Author sun
* @Description 数据统计服务
*/
public interface DataStatsService {
}

22
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -0,0 +1,22 @@
package com.epmet.dataaggre.service.datastats.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.datastats.DataStatsDao;
import com.epmet.dataaggre.service.datastats.DataStatsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @Author sun
* @Description 数据统计服务
*/
@Service
@DataSource(DataSourceConstant.DATA_STATISTICAL)
@Slf4j
public class DataStatsServiceImpl implements DataStatsService {
@Autowired
private DataStatsDao dataStatsDao;
}

5
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml

@ -129,6 +129,11 @@ dynamic:
url: @datasource.druid.opercrm.url@
username: @datasource.druid.opercrm.username@
password: @datasource.druid.opercrm.password@
datastatistical:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.opercrm.url@
username: @datasource.druid.opercrm.username@
password: @datasource.druid.opercrm.password@
feign:
hystrix:
enabled: true

7
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml

@ -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.epmet.dataaggre.dao.datastats.DataStatsDao">
</mapper>
Loading…
Cancel
Save