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
ce931707
Commit
ce931707
authored
Feb 03, 2021
by
huluobin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
# 更新
parent
6ebbb252
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1 addition
and
388 deletions
+1
-388
pom.xml
datacenter-job/datacenter-base/base-sync-amazon-ad/pom.xml
+0
-68
Dockerfile
...enter-base/base-sync-amazon-ad/src/main/docker/Dockerfile
+0
-8
AmazonAdJob.java
...mazon-ad/src/main/java/com/bailuntec/job/AmazonAdJob.java
+0
-57
AmazonAdProduct.java
...n-ad/src/main/java/com/bailuntec/job/AmazonAdProduct.java
+0
-114
AmazonApp.java
...-amazon-ad/src/main/java/com/bailuntec/job/AmazonApp.java
+0
-29
AmazonJobService.java
...main/java/com/bailuntec/job/service/AmazonJobService.java
+0
-0
application-prod.yml
...se-sync-amazon-ad/src/main/resources/application-prod.yml
+0
-35
application-test.yml
...se-sync-amazon-ad/src/main/resources/application-test.yml
+0
-34
AmazonJobServiceTest.java
.../java/com/bailuntec/job/service/AmazonJobServiceTest.java
+0
-42
pom.xml
datacenter-job/datacenter-base/pom.xml
+1
-1
No files found.
datacenter-job/datacenter-base/base-sync-amazon-ad/pom.xml
deleted
100644 → 0
View file @
6ebbb252
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
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"
>
<parent>
<groupId>
com.bailuntec
</groupId>
<artifactId>
datacenter-base
</artifactId>
<version>
1.0-SNAPSHOT
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<properties>
<maven.compiler.target>
1.8
</maven.compiler.target>
<maven.compiler.source>
1.8
</maven.compiler.source>
<maven.compiler.encoding>
UTF-8
</maven.compiler.encoding>
<project.build.sourceEncoding>
UTF-8
</project.build.sourceEncoding>
<maven-surefire-plugin.version>
2.18.1
</maven-surefire-plugin.version>
<maven.build.timestamp.format>
yyyyMMddHHmm
</maven.build.timestamp.format>
<skipTests>
true
</skipTests>
</properties>
<artifactId>
base-sync-amazon-ad
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<packaging>
jar
</packaging>
<build>
<plugins>
<plugin>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-maven-plugin
</artifactId>
<version>
2.3.3.RELEASE
</version>
<configuration>
<mainClass>
com.bailuntec.job.AmazonApp
</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>
repackage
</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>
com.spotify
</groupId>
<artifactId>
docker-maven-plugin
</artifactId>
<version>
1.0.0
</version>
<configuration>
<skipDockerBuild>
false
</skipDockerBuild>
<imageName>
ccr.ccs.tencentyun.com/blt.data.job/base-sync-amazon-ad:${maven.build.timestamp}
</imageName>
<dockerDirectory>
src/main/docker
</dockerDirectory>
<resources>
<resource>
<targetPath>
/
</targetPath>
<directory>
${project.build.directory}
</directory>
<include>
${project.build.finalName}.jar
</include>
</resource>
</resources>
<serverId>
bailuntec-docker
</serverId>
</configuration>
</plugin>
</plugins>
</build>
</project>
datacenter-job/datacenter-base/base-sync-amazon-ad/src/main/docker/Dockerfile
deleted
100644 → 0
View file @
6ebbb252
FROM
openjdk:8-jdk-alpine
VOLUME
/tmp
ADD
base-sync-amazon-ad-1.0-SNAPSHOT.jar app.jar
RUN
echo
"Asia/Shanghai"
>
/etc/timezone
ENTRYPOINT
["java","-Xms2G","-Xmx2G","-jar","-Dspring.profiles.active=prod","/app.jar"]
EXPOSE
8080
datacenter-job/datacenter-base/base-sync-amazon-ad/src/main/java/com/bailuntec/job/AmazonAdJob.java
deleted
100644 → 0
View file @
6ebbb252
package
com
.
bailuntec
.
job
;
import
com.bailuntec.application.IDcBaseFinanceAmazonAdProductService
;
import
com.bailuntec.application.IJobAmazonAdLogService
;
import
com.bailuntec.job.service.AmazonJobService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/9/24 2:38 下午
*/
@Component
@Slf4j
public
class
AmazonAdJob
{
@Resource
private
IJobAmazonAdLogService
jobAmazonAdLogService
;
@Resource
private
IDcBaseFinanceAmazonAdProductService
dcBaseFinanceAmazonAdProductService
;
@Resource
AmazonJobService
amazonJobService
;
/**
* <p>
* 每天下午1点生成昨天的亚马逊广告报告
* </p>
*/
@Scheduled
(
cron
=
"0 0 12 * * ?"
)
public
void
generateAmazonAdReport
()
{
log
.
info
(
"每天下午1点生成昨天的亚马逊广告报告 任务开始"
);
amazonJobService
.
generateAmazonAdReport
();
log
.
info
(
"每天下午1点生成昨天的亚马逊广告报告 任务结束"
);
}
/**
* <p>
* 每小时下载未下载的报告
* </p>
*/
@Scheduled
(
cron
=
"0 0/1 * * * ?"
)
public
void
downloadAmazonAdReport
()
{
log
.
info
(
"每小时下载未下载的报告 任务开始"
);
amazonJobService
.
downloadAmazonAdReport
();
log
.
info
(
"每小时下载未下载的报告 任务结束"
);
}
}
datacenter-job/datacenter-base/base-sync-amazon-ad/src/main/java/com/bailuntec/job/AmazonAdProduct.java
deleted
100644 → 0
View file @
6ebbb252
package
com
.
bailuntec
.
job
;
import
com.alibaba.fastjson.annotation.JSONField
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
AmazonAdProduct
{
@JSONField
(
name
=
"campaignName"
)
private
String
campaignName
;
@JSONField
(
name
=
"campaignId"
)
private
String
campaignId
;
@JSONField
(
name
=
"adGroupName"
)
private
String
adGroupName
;
@JSONField
(
name
=
"adGroupId"
)
private
String
adGroupId
;
@JSONField
(
name
=
"impressions"
)
private
Integer
impressions
;
@JSONField
(
name
=
"clicks"
)
private
Integer
clicks
;
@JSONField
(
name
=
"cost"
)
private
BigDecimal
cost
;
@JSONField
(
name
=
"currency"
)
private
String
currency
;
@JSONField
(
name
=
"asin"
)
private
String
asin
;
@JSONField
(
name
=
"sku"
)
private
String
sku
;
@JSONField
(
name
=
"attributedConversions1d"
)
private
Integer
attributedConversionsOneday
;
@JSONField
(
name
=
"attributedConversions7d"
)
private
Integer
attributedConversionsSevenday
;
@JSONField
(
name
=
"attributedConversions14d"
)
private
Integer
attributedConversionsFourteenday
;
@JSONField
(
name
=
"attributedConversions30d"
)
private
Integer
attributedConversionsThirtyday
;
@JSONField
(
name
=
"attributedConversions1dSameSKU"
)
private
String
attributedConversionsOnedaySameSku
;
@JSONField
(
name
=
"attributedConversions7dSameSKU"
)
private
String
attributedConversionsSevendaySameSku
;
@JSONField
(
name
=
"attributedConversions14dSameSKU"
)
private
String
attributedConversionsFourteendaySameSku
;
@JSONField
(
name
=
"attributedConversions30dSameSKU"
)
private
String
attributedConversionsThirtydaySameSku
;
@JSONField
(
name
=
"attributedUnitsOrdered1d"
)
private
Integer
attributedUnitsOrderedOneday
;
@JSONField
(
name
=
"attributedUnitsOrdered7d"
)
private
Integer
attributedUnitsOrderedSevenday
;
@JSONField
(
name
=
"attributedUnitsOrdered14d"
)
private
String
attributedUnitsOrderedFourteenday
;
@JSONField
(
name
=
"attributedUnitsOrdered30d"
)
private
String
attributedUnitsOrderedThirtyday
;
@JSONField
(
name
=
"attributedSales1d"
)
private
Integer
attributedSalesOneday
;
@JSONField
(
name
=
"attributedSales7d"
)
private
Integer
attributedSalesSevenday
;
@JSONField
(
name
=
"attributedSales14d"
)
private
Integer
attributedSalesFourteenday
;
@JSONField
(
name
=
"attributedSales30d"
)
private
Integer
attributedSalesThirtyday
;
@JSONField
(
name
=
"attributedSales1dSameSKU"
)
private
String
attributedSalesOnedaySameSku
;
@JSONField
(
name
=
"attributedSales7dSameSKU"
)
private
String
attributedSalesSevendaySameSku
;
@JSONField
(
name
=
"attributedSales14dSameSKU"
)
private
String
attributedSalesFourteendaySameSku
;
@JSONField
(
name
=
"attributedSales30dSameSKU"
)
private
String
attributedSalesThirtydaySameSku
;
@JSONField
(
name
=
"attributedUnitsOrdered1dSameSKU"
)
private
String
attributedUnitsOrderedOnedaySameSku
;
@JSONField
(
name
=
"attributedUnitsOrdered7dSameSKU"
)
private
String
attributedUnitsOrderedSevendaySameSku
;
@JSONField
(
name
=
"attributedUnitsOrdered14dSameSKU"
)
private
String
attributedUnitsOrderedFourteendaySameSku
;
@JSONField
(
name
=
"attributedUnitsOrdered30dSameSKU"
)
private
String
attributedUnitsOrderedThirtydaySameSku
;
}
datacenter-job/datacenter-base/base-sync-amazon-ad/src/main/java/com/bailuntec/job/AmazonApp.java
deleted
100644 → 0
View file @
6ebbb252
package
com
.
bailuntec
.
job
;
import
org.springframework.boot.SpringApplication
;
import
org.springframework.boot.autoconfigure.SpringBootApplication
;
import
org.springframework.cloud.openfeign.EnableFeignClients
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/8/29 3:29 下午
*/
@SpringBootApplication
@EnableScheduling
@ComponentScan
(
"com.bailuntec"
)
@EnableAsync
@EnableFeignClients
public
class
AmazonApp
{
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
AmazonApp
.
class
,
args
);
}
}
datacenter-job/datacenter-base/base-sync-amazon-ad/src/main/java/com/bailuntec/job/service/AmazonJobService.java
deleted
100644 → 0
View file @
6ebbb252
This diff is collapsed.
Click to expand it.
datacenter-job/datacenter-base/base-sync-amazon-ad/src/main/resources/application-prod.yml
deleted
100644 → 0
View file @
6ebbb252
spring
:
# 服务名称
application
:
name
:
base-sync-amazon-ad
# 数据配置
datasource
:
url
:
jdbc:mysql://10.0.8.15:3306/bailun_datacenter?serverTimezone=GMT%2B8&characterEncoding=utf-8&rewriteBatchedStatements=true
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
main
:
allow-bean-definition-overriding
:
true
#mybatis plus 配置
mybatis-plus
:
mapper-locations
:
-
classpath*:com/bailuntec/mapper/*.xml
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
metrics
:
campaignName,campaignId,impressions,clicks,cost,currency,attributedConversions1d,attributedConversions7d,attributedConversions14d,attributedConversions30d,attributedConversions1dSameSKU,attributedConversions7dSameSKU,attributedConversions14dSameSKU,attributedConversions30dSameSKU,attributedUnitsOrdered1d,attributedUnitsOrdered7d,attributedUnitsOrdered14d,attributedUnitsOrdered30d,attributedSales1d,attributedSales7d,attributedSales14d,attributedSales30d,attributedSales1dSameSKU,attributedSales7dSameSKU,attributedSales14dSameSKU,attributedSales30dSameSKU,attributedUnitsOrdered1dSameSKU,attributedUnitsOrdered7dSameSKU,attributedUnitsOrdered14dSameSKU,attributedUnitsOrdered30dSameSKU
feign
:
hystrix
:
enabled
:
false
client
:
config
:
default
:
connectTimeout
:
30000
readTimeout
:
30000
server
:
port
:
8080
datacenter-job/datacenter-base/base-sync-amazon-ad/src/main/resources/application-test.yml
deleted
100644 → 0
View file @
6ebbb252
spring
:
# 服务名称
application
:
name
:
base-sync-amazon-ad
# 数据配置
datasource
:
url
:
jdbc:mysql://gz-cdb-kp7s5i79.sql.tencentcdb.com:61691/bailun_datacenter?serverTimezone=GMT%2B8&characterEncoding=utf-8&rewriteBatchedStatements=true
username
:
root
password
:
'
#7kfnymAM$Y9-Ntf'
driver-class-name
:
com.mysql.jdbc.Driver
main
:
allow-bean-definition-overriding
:
true
#mybatis plus 配置
mybatis-plus
:
mapper-locations
:
-
classpath*:com/bailuntec/mapper/*.xml
# configuration:
# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
metrics
:
campaignName,campaignId,impressions,clicks,cost,currency,attributedConversions1d,attributedConversions7d,attributedConversions14d,attributedConversions30d,attributedConversions1dSameSKU,attributedConversions7dSameSKU,attributedConversions14dSameSKU,attributedConversions30dSameSKU,attributedUnitsOrdered1d,attributedUnitsOrdered7d,attributedUnitsOrdered14d,attributedUnitsOrdered30d,attributedSales1d,attributedSales7d,attributedSales14d,attributedSales30d,attributedSales1dSameSKU,attributedSales7dSameSKU,attributedSales14dSameSKU,attributedSales30dSameSKU,attributedUnitsOrdered1dSameSKU,attributedUnitsOrdered7dSameSKU,attributedUnitsOrdered14dSameSKU,attributedUnitsOrdered30dSameSKU
feign
:
hystrix
:
enabled
:
false
client
:
config
:
default
:
connectTimeout
:
30000
readTimeout
:
30000
server
:
port
:
1223
datacenter-job/datacenter-base/base-sync-amazon-ad/src/test/java/com/bailuntec/job/service/AmazonJobServiceTest.java
deleted
100644 → 0
View file @
6ebbb252
package
com
.
bailuntec
.
job
.
service
;
import
com.bailuntec.job.AmazonApp
;
import
lombok.extern.slf4j.Slf4j
;
import
org.junit.jupiter.api.Test
;
import
org.junit.runner.RunWith
;
import
org.springframework.boot.test.context.SpringBootTest
;
import
org.springframework.cloud.netflix.hystrix.EnableHystrix
;
import
org.springframework.test.context.ActiveProfiles
;
import
org.springframework.test.context.junit4.SpringRunner
;
import
javax.annotation.Resource
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
/**
* <p>
*
* </p>
*
* @author robbendev
* @since 2020/11/12 3:24 下午
*/
@ActiveProfiles
(
value
=
"test"
)
@Slf4j
@RunWith
(
SpringRunner
.
class
)
@SpringBootTest
(
classes
=
AmazonApp
.
class
)
class
AmazonJobServiceTest
{
@Resource
AmazonJobService
amazonJobService
;
@Test
void
generateAmazonAdReport
()
{
amazonJobService
.
generateAmazonAdReport
();
}
@Test
void
downloadAmazonAdReport
(){
amazonJobService
.
downloadAmazonAdReport
();
}
}
datacenter-job/datacenter-base/pom.xml
View file @
ce931707
...
...
@@ -15,7 +15,7 @@
<packaging>
pom
</packaging>
<modules>
<
module>
base-sync-amazon-ad
</module
>
<
!-- <module>base-sync-amazon-ad</module>--
>
<module>
base-sync-cashier
</module>
<module>
base-sync-fee
</module>
<module>
base-sync-sample
</module>
...
...
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