Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
package cn.stock.market.infrastructure.stockdb.po;
|
||||
package cn.stock.market.infrastructure.db.po;
|
||||
|
||||
import static com.querydsl.core.types.PathMetadataFactory.*;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.stock.market.infrastructure.stockdb.po;
|
||||
package cn.stock.market.infrastructure.db.po;
|
||||
|
||||
import static com.querydsl.core.types.PathMetadataFactory.*;
|
||||
|
||||
@@ -6,7 +6,7 @@ import org.springframework.stereotype.Component;
|
||||
import cn.qutaojing.common.domain.convert.SimpleEntityPOConvert;
|
||||
import cn.qutaojing.common.utils.SpringUtils;
|
||||
import cn.stock.market.domain.basic.entity.SiteSetting;
|
||||
import cn.stock.market.infrastructure.stockdb.po.SiteSettingPO;
|
||||
import cn.stock.market.infrastructure.db.po.SiteSettingPO;
|
||||
|
||||
/**
|
||||
* StockConvert
|
||||
|
||||
@@ -3,7 +3,7 @@ package cn.stock.market.domain.basic.convert;
|
||||
import cn.qutaojing.common.domain.convert.SimpleEntityPOConvert;
|
||||
import cn.qutaojing.common.utils.SpringUtils;
|
||||
import cn.stock.market.domain.basic.entity.Stock;
|
||||
import cn.stock.market.infrastructure.stockdb.po.StockPO;
|
||||
import cn.stock.market.infrastructure.db.po.StockPO;
|
||||
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.google.common.collect.Lists;
|
||||
|
||||
import cn.qutaojing.common.utils.Beans;
|
||||
import cn.stock.market.dto.command.StockCreateCommand;
|
||||
import cn.stock.market.infrastructure.stockdb.po.SiteSettingPO;
|
||||
import cn.stock.market.infrastructure.db.po.SiteSettingPO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -2,7 +2,7 @@ package cn.stock.market.domain.basic.entity;
|
||||
|
||||
import cn.qutaojing.common.utils.Beans;
|
||||
import cn.stock.market.dto.command.StockCreateCommand;
|
||||
import cn.stock.market.infrastructure.stockdb.po.StockPO;
|
||||
import cn.stock.market.infrastructure.db.po.StockPO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -10,8 +10,8 @@ import cn.qutaojing.common.domain.respostory.LocalCacheRepository;
|
||||
import cn.qutaojing.common.utils.SpringUtils;
|
||||
import cn.stock.market.domain.basic.convert.SiteSettingConvert;
|
||||
import cn.stock.market.domain.basic.entity.SiteSetting;
|
||||
import cn.stock.market.infrastructure.stockdb.po.SiteSettingPO;
|
||||
import cn.stock.market.infrastructure.stockdb.repo.SiteSettingRepo;
|
||||
import cn.stock.market.infrastructure.db.po.SiteSettingPO;
|
||||
import cn.stock.market.infrastructure.db.repo.SiteSettingRepo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,7 +5,7 @@ import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.stock.market.infrastructure.stockdb.po.QStockPO;
|
||||
import cn.stock.market.infrastructure.db.po.QStockPO;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
@@ -22,8 +22,8 @@ import cn.qutaojing.common.jpa.ConditionBuilder;
|
||||
import cn.qutaojing.common.utils.SpringUtils;
|
||||
import cn.stock.market.domain.basic.convert.StockConvert;
|
||||
import cn.stock.market.domain.basic.entity.Stock;
|
||||
import cn.stock.market.infrastructure.stockdb.po.StockPO;
|
||||
import cn.stock.market.infrastructure.stockdb.repo.StockRepo;
|
||||
import cn.stock.market.infrastructure.db.po.StockPO;
|
||||
import cn.stock.market.infrastructure.db.repo.StockRepo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
/**
|
||||
|
||||
@@ -22,7 +22,7 @@ import okhttp3.Protocol;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Request.Builder;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import cn.stock.market.infrastructure.stockdb.po.QStockPO;
|
||||
import cn.stock.market.infrastructure.db.po.QStockPO;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.http.HttpEntity;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package cn.stock.market.dto;
|
||||
|
||||
import cn.stock.market.infrastructure.stockdb.po.StockPO;
|
||||
import cn.stock.market.infrastructure.db.po.StockPO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.stock.market.infrastructure.stockdb.po;
|
||||
package cn.stock.market.infrastructure.db.po;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
@@ -33,6 +33,6 @@ public class SiteSettingPO {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
Integer id;
|
||||
|
||||
|
||||
String marketServerList;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package cn.stock.market.infrastructure.stockdb.po;
|
||||
package cn.stock.market.infrastructure.db.po;
|
||||
|
||||
import java.lang.Integer;
|
||||
import java.lang.String;
|
||||
@@ -63,6 +63,6 @@ public class StockPO {
|
||||
* 涨幅比例
|
||||
*/
|
||||
BigDecimal increaseRatio;
|
||||
|
||||
|
||||
Integer stockState;
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.stock.market.infrastructure.stockdb.repo;
|
||||
package cn.stock.market.infrastructure.db.repo;
|
||||
|
||||
import com.rp.spring.jpa.GenericJpaRepository;
|
||||
|
||||
import cn.stock.market.infrastructure.stockdb.po.SiteSettingPO;
|
||||
import cn.stock.market.infrastructure.db.po.SiteSettingPO;
|
||||
|
||||
/**
|
||||
* StockRepo
|
||||
@@ -1,8 +1,8 @@
|
||||
package cn.stock.market.infrastructure.stockdb.repo;
|
||||
package cn.stock.market.infrastructure.db.repo;
|
||||
|
||||
import com.rp.spring.jpa.GenericJpaRepository;
|
||||
|
||||
import cn.stock.market.infrastructure.stockdb.po.StockPO;
|
||||
import cn.stock.market.infrastructure.db.po.StockPO;
|
||||
|
||||
import java.lang.Integer;
|
||||
|
||||
@@ -1,77 +1,77 @@
|
||||
package cn.stock.market.infrastructure.stockdb.config;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
import org.springframework.orm.jpa.JpaTransactionManager;
|
||||
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
import org.springframework.transaction.PlatformTransactionManager;
|
||||
|
||||
import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||
import com.rp.spring.jpa.GenericJpaRepositoryFactoryBean;
|
||||
import com.rp.spring.jpa.GenericJpaRepositoryImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* title: ErpDatasourceConfig.java
|
||||
* ERP 数据源设置
|
||||
*
|
||||
* @author rplees
|
||||
* @email rplees.i.ly@gmail.com
|
||||
* @version 1.0
|
||||
* @created Jan 5, 2018 11:44:49 AM
|
||||
*/
|
||||
@Configuration
|
||||
@ComponentScan({ "cn.stock.market.infrastructure.stockdb.po", "cn.stock.market.infrastructure.stockdb.repo"})
|
||||
@EnableJpaRepositories(
|
||||
repositoryBaseClass = GenericJpaRepositoryImpl.class,
|
||||
repositoryFactoryBeanClass = GenericJpaRepositoryFactoryBean.class,
|
||||
entityManagerFactoryRef = "stockEntityManagerFactory",
|
||||
transactionManagerRef = "stockTransactionManager",
|
||||
basePackages = { "cn.stock.market.infrastructure.stockdb.po", "cn.stock.market.infrastructure.stockdb.repo"})
|
||||
public class StockDatasourceConfig {
|
||||
@Autowired HibernateProperties hibernateProperties;
|
||||
@Bean(name = "stockDataSource")
|
||||
@ConfigurationProperties(prefix="spring.datasource.stock")
|
||||
public DataSource dataSource() {
|
||||
return DruidDataSourceBuilder.create().build();
|
||||
}
|
||||
|
||||
@Bean(name = "stockJpaProperties")
|
||||
@ConfigurationProperties(prefix = "spring.jpa")
|
||||
public JpaProperties jpaProperties() {
|
||||
return new JpaProperties();
|
||||
}
|
||||
|
||||
@Bean(name = "stockEntityManagerFactory")
|
||||
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
|
||||
EntityManagerFactoryBuilder builder,
|
||||
@Qualifier("stockJpaProperties") JpaProperties jpaProperties,
|
||||
@Qualifier("stockDataSource") DataSource dataSource) {
|
||||
Map<String, Object> properties = hibernateProperties.determineHibernateProperties(jpaProperties.getProperties(), new HibernateSettings());
|
||||
return builder
|
||||
.dataSource(dataSource)
|
||||
.properties(properties)
|
||||
.packages("cn.stock.market.infrastructure.stockdb.po")
|
||||
.persistenceUnit("stock")
|
||||
.build();
|
||||
}
|
||||
|
||||
@Bean(name = "stockTransactionManager")
|
||||
public PlatformTransactionManager transactionManager(@Qualifier("stockEntityManagerFactory") EntityManagerFactory entityManagerFactory) {
|
||||
return new JpaTransactionManager(entityManagerFactory);
|
||||
}
|
||||
}
|
||||
//package cn.stock.market.infrastructure.stockdb.config;
|
||||
//
|
||||
//import java.util.Map;
|
||||
//
|
||||
//import javax.persistence.EntityManagerFactory;
|
||||
//import javax.sql.DataSource;
|
||||
//
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.beans.factory.annotation.Qualifier;
|
||||
//import org.springframework.boot.autoconfigure.orm.jpa.HibernateProperties;
|
||||
//import org.springframework.boot.autoconfigure.orm.jpa.HibernateSettings;
|
||||
//import org.springframework.boot.autoconfigure.orm.jpa.JpaProperties;
|
||||
//import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
//import org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder;
|
||||
//import org.springframework.context.annotation.Bean;
|
||||
//import org.springframework.context.annotation.ComponentScan;
|
||||
//import org.springframework.context.annotation.Configuration;
|
||||
//import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
//import org.springframework.orm.jpa.JpaTransactionManager;
|
||||
//import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
|
||||
//import org.springframework.transaction.PlatformTransactionManager;
|
||||
//
|
||||
//import com.alibaba.druid.spring.boot.autoconfigure.DruidDataSourceBuilder;
|
||||
//import com.rp.spring.jpa.GenericJpaRepositoryFactoryBean;
|
||||
//import com.rp.spring.jpa.GenericJpaRepositoryImpl;
|
||||
//
|
||||
///**
|
||||
// *
|
||||
// * title: ErpDatasourceConfig.java
|
||||
// * ERP 数据源设置
|
||||
// *
|
||||
// * @author rplees
|
||||
// * @email rplees.i.ly@gmail.com
|
||||
// * @version 1.0
|
||||
// * @created Jan 5, 2018 11:44:49 AM
|
||||
// */
|
||||
//@Configuration
|
||||
//@ComponentScan({ "cn.stock.market.infrastructure.stockdb.po", "cn.stock.market.infrastructure.stockdb.repo"})
|
||||
//@EnableJpaRepositories(
|
||||
// repositoryBaseClass = GenericJpaRepositoryImpl.class,
|
||||
// repositoryFactoryBeanClass = GenericJpaRepositoryFactoryBean.class,
|
||||
// entityManagerFactoryRef = "stockEntityManagerFactory",
|
||||
// transactionManagerRef = "stockTransactionManager",
|
||||
// basePackages = { "cn.stock.market.infrastructure.stockdb.po", "cn.stock.market.infrastructure.stockdb.repo"})
|
||||
//public class StockDatasourceConfig {
|
||||
// @Autowired HibernateProperties hibernateProperties;
|
||||
// @Bean(name = "stockDataSource")
|
||||
// @ConfigurationProperties(prefix="spring.datasource.stock")
|
||||
// public DataSource dataSource() {
|
||||
// return DruidDataSourceBuilder.create().build();
|
||||
// }
|
||||
//
|
||||
// @Bean(name = "stockJpaProperties")
|
||||
// @ConfigurationProperties(prefix = "spring.jpa")
|
||||
// public JpaProperties jpaProperties() {
|
||||
// return new JpaProperties();
|
||||
// }
|
||||
//
|
||||
// @Bean(name = "stockEntityManagerFactory")
|
||||
// public LocalContainerEntityManagerFactoryBean entityManagerFactory(
|
||||
// EntityManagerFactoryBuilder builder,
|
||||
// @Qualifier("stockJpaProperties") JpaProperties jpaProperties,
|
||||
// @Qualifier("stockDataSource") DataSource dataSource) {
|
||||
// Map<String, Object> properties = hibernateProperties.determineHibernateProperties(jpaProperties.getProperties(), new HibernateSettings());
|
||||
// return builder
|
||||
// .dataSource(dataSource)
|
||||
// .properties(properties)
|
||||
// .packages("cn.stock.market.infrastructure.stockdb.po")
|
||||
// .persistenceUnit("stock")
|
||||
// .build();
|
||||
// }
|
||||
//
|
||||
// @Bean(name = "stockTransactionManager")
|
||||
// public PlatformTransactionManager transactionManager(@Qualifier("stockEntityManagerFactory") EntityManagerFactory entityManagerFactory) {
|
||||
// return new JpaTransactionManager(entityManagerFactory);
|
||||
// }
|
||||
//}
|
||||
|
||||
@@ -3,7 +3,7 @@ spring:
|
||||
show-sql: true
|
||||
# Redis配置
|
||||
redis:
|
||||
host: 43.128.20.124
|
||||
host: 43.132.212.180
|
||||
password: ruTZ9J3gaDhknJ
|
||||
port: 36379
|
||||
database: 1
|
||||
@@ -17,7 +17,7 @@ spring:
|
||||
datasource:
|
||||
stock-market:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://124.156.133.209:33306/stock-market?useUnicode=true&characterEncoding=utf-8
|
||||
url: jdbc:mysql://43.132.212.180:33306/india_stock?useUnicode=true&characterEncoding=utf-8
|
||||
username: root
|
||||
password: 33BsUUcnXRYgwt
|
||||
maxActive: 500
|
||||
|
||||
Reference in New Issue
Block a user