Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-datacenter
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
huluobin
bailuntec-datacenter
Commits
a8836dd9
Commit
a8836dd9
authored
Jan 21, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# update
parent
077bf334
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
58 additions
and
22 deletions
+58
-22
pom.xml
datacenter-job/datacenter-base/base-sync-ebay/pom.xml
+5
-0
DataSourceConfig.java
...bay/src/main/java/com/bailuntec/job/DataSourceConfig.java
+15
-18
EbayFinanceTaskApp.java
...y/src/main/java/com/bailuntec/job/EbayFinanceTaskApp.java
+2
-3
GeneratorTaskConfigurer.java
.../main/java/com/bailuntec/job/GeneratorTaskConfigurer.java
+23
-0
application-prod.yml
...se/base-sync-ebay/src/main/resources/application-prod.yml
+7
-0
application-test.yml
...se/base-sync-ebay/src/main/resources/application-test.yml
+6
-1
No files found.
datacenter-job/datacenter-base/base-sync-ebay/pom.xml
View file @
a8836dd9
...
@@ -25,6 +25,11 @@
...
@@ -25,6 +25,11 @@
<artifactId>
ebaycalls
</artifactId>
<artifactId>
ebaycalls
</artifactId>
<version>
1065
</version>
<version>
1065
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.cloud
</groupId>
<artifactId>
spring-cloud-starter-task
</artifactId>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
datacenter-job/datacenter-base/base-sync-ebay/src/main/java/com/bailuntec/job/DataSourceConfig.java
View file @
a8836dd9
package
com
.
bailuntec
.
job
;
package
com
.
bailuntec
.
job
;
import
com.zaxxer.hikari.HikariConfig
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
com.zaxxer.hikari.HikariDataSource
;
import
org.springframework.boot.jdbc.DataSourceBuilder
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Primary
;
import
javax.sql.DataSource
;
import
javax.sql.DataSource
;
...
@@ -19,22 +19,19 @@ import javax.sql.DataSource;
...
@@ -19,22 +19,19 @@ import javax.sql.DataSource;
@Configuration
@Configuration
public
class
DataSourceConfig
{
public
class
DataSourceConfig
{
@Value
(
"${spring.datasource.url}"
)
String
url
;
@Value
(
"${spring.datasource.username}"
)
String
username
;
@Value
(
"${spring.datasource.password}"
)
String
password
;
@Value
(
"${spring.datasource.driver-class-name}"
)
String
driverClassName
;
@Bean
@Bean
public
DataSource
dataSource
()
{
@ConfigurationProperties
(
prefix
=
"spring.dataflow-datasource"
)
HikariConfig
hikariConfig
=
new
HikariConfig
();
public
DataSource
dataflowDataSource
()
{
hikariConfig
.
setDriverClassName
(
driverClassName
);
return
DataSourceBuilder
.
create
().
build
();
hikariConfig
.
setJdbcUrl
(
url
);
hikariConfig
.
setUsername
(
username
);
hikariConfig
.
setPassword
(
password
);
return
new
HikariDataSource
(
hikariConfig
);
}
}
@Primary
@Bean
@ConfigurationProperties
(
prefix
=
"spring.dataflow"
)
public
DataSource
bizDataSource
()
{
return
DataSourceBuilder
.
create
().
build
();
}
}
}
datacenter-job/datacenter-base/base-sync-ebay/src/main/java/com/bailuntec/job/EbayFinance
Job
.java
→
datacenter-job/datacenter-base/base-sync-ebay/src/main/java/com/bailuntec/job/EbayFinance
TaskApp
.java
View file @
a8836dd9
package
com
.
bailuntec
.
job
;
package
com
.
bailuntec
.
job
;
import
org.mybatis.spring.annotation.MapperScan
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
...
@@ -19,9 +18,9 @@ import org.springframework.scheduling.annotation.EnableScheduling;
...
@@ -19,9 +18,9 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling
@EnableScheduling
@ComponentScan
(
"com.bailuntec"
)
@ComponentScan
(
"com.bailuntec"
)
@EnableFeignClients
(
basePackages
=
{
"com.bailuntec.api"
,
"com.bailuntec.*.api"
})
@EnableFeignClients
(
basePackages
=
{
"com.bailuntec.api"
,
"com.bailuntec.*.api"
})
public
class
EbayFinance
Job
{
public
class
EbayFinance
TaskApp
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
EbayFinance
Job
.
class
,
args
);
SpringApplication
.
run
(
EbayFinance
TaskApp
.
class
,
args
);
}
}
}
}
datacenter-job/datacenter-base/base-sync-ebay/src/main/java/com/bailuntec/job/GeneratorTaskConfigurer.java
0 → 100644
View file @
a8836dd9
package
com
.
bailuntec
.
job
;
import
org.springframework.beans.factory.annotation.Qualifier
;
import
org.springframework.cloud.task.configuration.DefaultTaskConfigurer
;
import
org.springframework.context.annotation.Configuration
;
import
javax.sql.DataSource
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2021/1/21 9:31 上午
*/
@Configuration
public
class
GeneratorTaskConfigurer
extends
DefaultTaskConfigurer
{
public
GeneratorTaskConfigurer
(
@Qualifier
(
"dataflowDataSource"
)
DataSource
dataSource
)
{
super
(
dataSource
);
}
}
datacenter-job/datacenter-base/base-sync-ebay/src/main/resources/application-prod.yml
View file @
a8836dd9
...
@@ -8,6 +8,13 @@ spring:
...
@@ -8,6 +8,13 @@ spring:
username
:
root
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
dataflow-dataSource
:
url
:
jdbc:mysql://${MYSQL_SERVICE_HOST}:${MYSQL_SERVICE_PORT}/mysql
username
:
root
password
:
${mysql-root-password}
driverClassName
:
org.mariadb.jdbc.Driver
testOnBorrow
:
true
validationQuery
:
"
SELECT
1"
main
:
main
:
allow-bean-definition-overriding
:
true
allow-bean-definition-overriding
:
true
batch
:
batch
:
...
...
datacenter-job/datacenter-base/base-sync-ebay/src/main/resources/application-test.yml
View file @
a8836dd9
...
@@ -4,7 +4,12 @@ spring:
...
@@ -4,7 +4,12 @@ spring:
name
:
base-sync-ebay
name
:
base-sync-ebay
# 数据配置
# 数据配置
datasource
:
datasource
:
url
:
jdbc:mysql://gz-cdb-kp7s5i79.sql.tencentcdb.com:61691/bailun_datecenter_test?serverTimezone=GMT%2B8&characterEncoding=utf-8&rewriteBatchedStatements=true
jdbcUrl
:
jdbc:mysql://gz-cdb-kp7s5i79.sql.tencentcdb.com:61691/bailun_datecenter_test?serverTimezone=GMT%2B8&characterEncoding=utf-8&rewriteBatchedStatements=true
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
dataflow-dataSource
:
jdbcUrl
:
jdbc:mysql://gz-cdb-kp7s5i79.sql.tencentcdb.com:61691/bailun_datecenter_test?serverTimezone=GMT%2B8&characterEncoding=utf-8&rewriteBatchedStatements=true
username
:
root
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment